Private Sub UserForm_Initialize()
Dim fc As Worksheet, wb As Workbook, ws As Worksheet, nb As Long, VPC As Object, vbProj As Object
Dim listeFeuillesProtegees As String
Set Wbk = ActiveWorkbook
If colonne >= 1 Then
Lbt11.BackColor = vbRed
Label18.Caption = IIf(colonne >= 2, "Colonnes masquées", "Colonne masquée")
Bbt11.Caption = "(" & colonne & ")"
Else
Label18.Caption = "Toutes les colonnes visibles"
Lbt11.BackColor = vbGreen
Bbt11.Caption = "Ok"
End If
If ligne >= 1 Then
Lbt12.BackColor = vbRed
Label17.Caption = IIf(colonne >= 2, "Lignes masquées", "Ligne masquée")
Bbt12.Caption = "(" & ligne & ")"
Else
Label17.Caption = "Toutes les lignes visibles"
Lbt12.BackColor = vbGreen
Bbt12.Caption = "Ok"
End If
End Sub
Public Function colonne()
Dim ws As Worksheet
Dim i As Long
Dim MaxColumns As Long
MaxColumns = 500
colonne = 0
For Each ws In Wbk.Worksheets
For i = 1 To MaxColumns
If ws.Columns(i).Hidden Then
colonne = colonne + 1
End If
Next i
Next ws
End Function
Public Function ligne()
Dim ws As Worksheet
Dim i As Long
Dim MaxRows As Long
MaxRows = 5000
ligne = 0
For Each ws In Wbk.Worksheets
For i = 1 To MaxRows
If ws.Rows(i).Hidden Then
ligne = ligne + 1
End If
Next i
Next ws
End Function