case à cocher et macro

flo2002

XLDnaute Impliqué
Bonjour à tous ceux que je n'estb pas deja vu!

Je souhaite lié des case à cocher à une macro qui me masque certaine colonne.


Peut etre estce plus clair avec un fichier [file name=forum_20060511134612.zip size=50426]http://www.excel-downloads.com/components/com_simpleboard/uploaded/files/forum_20060511134612.zip[/file]
 

Pièces jointes

  • forum_20060511134612.zip
    49.2 KB · Affichages: 14

flo2002

XLDnaute Impliqué
j ai repirs la demo de Luc et est tenté de l'adapter a mon besoin!

mais au niveau du range ca lui pose un probleme!

Private Sub CheckBox1_Click()
Application.ScreenUpdating = False
If CheckBox1 Then

Sheets('Rolling_Forecast').Select

Range('f:g,r:s,ad:ae,ap:ap,av:aw,bh:bi,bt:bu,cf:cf,cl:cm,cx:cy,dj:dk,dv:dv,eb:ec,en:eo,ez:fa,fl:fl,fr:fr,fx:fx').Select
Selection.EntireRow.Hidden = True
Range('A1').Select
End If
If Not CheckBox1 Then


Range('f:g,r:s,ad:ae,ap:ap,av:aw,bh:bi,bt:bu,cf:cf,cl:cm,cx:cy,dj:dk,dv:dv,eb:ec,en:eo,ez:fa,fl:fl,fr:fr,fx:fx').Select
Selection.EntireRow.Hidden = False

Range('A1').Select

End If
Application.ScreenUpdating = True

Sheets('Garde').Select

End Sub
 
L

Luc

Guest
re.Bonjour
teste ceci

Private Sub CheckBox1_Click()
Application.ScreenUpdating = False
If CheckBox1 Then

Sheets('Rolling_Forecast').Select

Columns('f:g,r,ad:ae,ap:ap,av:aw,bh:bi,bt:bu,cf:cf,cl:cm,cx:cy,dj:dk,dv:dv,eb:ec,en:eo,ez:fa,fl:fl,fr:fr,fx:fx\\').EntireRow.Hidden = True
Range('A1').Select
End If
If Not CheckBox1 Then


Columns('f:g,r,ad:ae,ap:ap,av:aw,bh:bi,bt:bu,cf:cf,cl:cm,cx:cy,dj:dk,dv:dv,eb:ec,en:eo,ez:fa,fl:fl,fr:fr,fx:fx\\').EntireRow.Hidden = True

Range('A1').Select

End If
Application.ScreenUpdating = True

Sheets('Garde').Select

End Sub
 

flo2002

XLDnaute Impliqué
Je viens d'essayer mais il me dit incompatible de type.

sinon j'avais essayer quelque chose comme ca:

Range('f:g, r:s, ad:ae, ap:ap, av:aw, bh:bi, bt:bu, cf:cf, cl:cm, cx:cy, dj:dk, dv:dv, eb:ec, en:eo, ez:fa, fl:fl, fr:fr, fx:fx').Select
Selection.EntireColumn.Hidden = True


mais toujours rien...

Message édité par: flo2002, à: 11/05/2006 18:09
 

Discussions similaires

Statistiques des forums

Discussions
312 100
Messages
2 085 293
Membres
102 853
dernier inscrit
jetstream69