Re : Un peut d'aide sur VBA
Bonjour,
je suis toujours perdu dans cette serie de commandes
Private Sub CommandButton4_Click()
Dim col As Variant
Dim i As Integer
Dim Ind As Integer, TabMois() As String, ShtS As Worksheet
If CommandButton4.Caption = "Masqué Col" Then
CommandButton4.BackColor = &HFF&
'selectionner les douze feuilles pour effectuer la même commande
TabMois = Split("Janvier,fevrier,mars,avril,mai,juin,juillet,aout,septembre,octobre,novembre,decembre", ",")
For Ind = 0 To UBound(TabMois)
Set ShtS = Sheets(TabMois(Ind))
Next
'démasquer les colones de 170 à 206 et masques que les colones vide ligne 64
For col = 170 To 206
With ActiveSheet.Cells(64, col)
Columns(col).Hidden = IIf(CommandButton3.Caption = "Masqué" And Columns(64, col) = "", True, False)
'If .Value = "" Then Columns(col).Hidden = True
' Next col
End With
CommandButton4.Caption = "Démasqué Col"
CommandButton4.BackColor = &HC000&
' For col = 170 To 206
' With ActiveSheet.Cells(64, col)
' If .Value = "" Then Columns(col).Hidden = False
' End With
Else
CommandButton4.Caption = "Masqué Col"
CommandButton4.BackColor = &HFF&
End If
End Sub