Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Double clic pour agrandir une feuille, comment inverser

3 réponses
Avatar
pellet15
Bonjour =E0 tous

La macros suivante me permet d'agrandir une des 4 fen=EAtres qui sont
superposer a l'=E9cran.

Mais une fois quel est agrandie, si je double clic, je voudrait
inverser la r=E9duire !!!

Comment modifier cette macro?

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
As Boolean)
If Intersect(Target, Range("A2:m65536")) Is Nothing Then GoTo fin
ActiveWorkbook.Unprotect
ActiveWindow.WindowState =3D xlMaximized
ActiveWorkbook.Protect Structure:=3DTrue, Windows:=3DTrue
fin:
Range("A2").Select
End Sub


Merci

3 réponses

Avatar
Philippe.R
Bonjour,
Comme ceci ?

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Intersect(Target, Range("A2:m65536")) Is Nothing Then GoTo fin
ActiveWorkbook.Unprotect
If ActiveWindow.WindowState = xlNormal Then
ActiveWindow.WindowState = xlMaximized
Else
ActiveWindow.WindowState = xlNormal
End If
ActiveWorkbook.Protect Structure:=True, Windows:=True
fin:
Range("A2").Select
End Sub

--
Avec plaisir
http://dj.joss.free.fr/trombine.htm
http://jacxl.free.fr/mpfe/trombino.html
Philippe.R
Pour se connecter au forum :
http://www.excelabo.net/mpfe/connexion.php
News://news.microsoft.com/microsoft.public.fr.excel
"pellet15" a écrit dans le message de
news:
Bonjour à tous

La macros suivante me permet d'agrandir une des 4 fenêtres qui sont
superposer a l'écran.

Mais une fois quel est agrandie, si je double clic, je voudrait
inverser la réduire !!!

Comment modifier cette macro?

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
As Boolean)
If Intersect(Target, Range("A2:m65536")) Is Nothing Then GoTo fin
ActiveWorkbook.Unprotect
ActiveWindow.WindowState = xlMaximized
ActiveWorkbook.Protect Structure:=True, Windows:=True
fin:
Range("A2").Select
End Sub


Merci
Avatar
pellet15
On 16 nov, 10:15, "Philippe.R" <AS_rauphil_chez_wanadoo.fr> wrote:
Bonjour,
Comme ceci ?

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Intersect(Target, Range("A2:m65536")) Is Nothing Then GoTo fin
    ActiveWorkbook.Unprotect
    If ActiveWindow.WindowState = xlNormal Then
        ActiveWindow.WindowState = xlMaximized
    Else
        ActiveWindow.WindowState = xlNormal
    End If
    ActiveWorkbook.Protect Structure:=True, Windows:=True
fin:
Range("A2").Select
End Sub

--
Avec plaisirhttp://dj.joss.free.fr/trombine.htmhttp://jacxl.free.fr/mpfe/ trombino.html
Philippe.R
Pour se connecter au forum :http://www.excelabo.net/mpfe/connexion.php
News://news.microsoft.com/microsoft.public.fr.excel
"pellet15" a écrit dans le message denews:4eba8
Bonjour à tous

La macros suivante me permet d'agrandir une des 4 fenêtres qui sont
superposer a l'écran.

Mais une fois quel est agrandie, si je double clic, je voudrait
inverser la réduire !!!

Comment modifier cette macro?

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
As Boolean)
If Intersect(Target, Range("A2:m65536")) Is Nothing Then GoTo fin
    ActiveWorkbook.Unprotect
    ActiveWindow.WindowState = xlMaximized
    ActiveWorkbook.Protect Structure:=True, Windows:=True
fin:
Range("A2").Select
End Sub

Merci



Gros Merci cela répond très bien
Avatar
michdenis
Si tu avais utilisé la forme négative comme dans :

If not Intersect(Target, Range("A2:m65536")) Is Nothing Then

Cela t'aurait évité d'utilser le Goto Fin


"Philippe.R" <AS_rauphil_chez_wanadoo.fr> a écrit dans le message de news:
u67l%234$
Bonjour,
Comme ceci ?

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Intersect(Target, Range("A2:m65536")) Is Nothing Then GoTo fin
ActiveWorkbook.Unprotect
If ActiveWindow.WindowState = xlNormal Then
ActiveWindow.WindowState = xlMaximized
Else
ActiveWindow.WindowState = xlNormal
End If
ActiveWorkbook.Protect Structure:=True, Windows:=True
fin:
Range("A2").Select
End Sub

--
Avec plaisir
http://dj.joss.free.fr/trombine.htm
http://jacxl.free.fr/mpfe/trombino.html
Philippe.R
Pour se connecter au forum :
http://www.excelabo.net/mpfe/connexion.php
News://news.microsoft.com/microsoft.public.fr.excel
"pellet15" a écrit dans le message de
news:
Bonjour à tous

La macros suivante me permet d'agrandir une des 4 fenêtres qui sont
superposer a l'écran.

Mais une fois quel est agrandie, si je double clic, je voudrait
inverser la réduire !!!

Comment modifier cette macro?

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
As Boolean)
If Intersect(Target, Range("A2:m65536")) Is Nothing Then GoTo fin
ActiveWorkbook.Unprotect
ActiveWindow.WindowState = xlMaximized
ActiveWorkbook.Protect Structure:=True, Windows:=True
fin:
Range("A2").Select
End Sub


Merci