< návrat zpět
MS Excel
Téma: Makro pro všechny listy
Zaslal/a Lugr 14.4.2019 17:43
Dobrý den,
lze provést toto makro na všech listech?
Nějak si s tím nevím rady.
Sub skryt()
Dim wsSheet As Worksheet
Set wsSheet = Worksheets("List1")
If wsSheet.Columns("C:C").EntireColumn.Hidden = False Then
wsSheet.Columns("C:C").EntireColumn.Hidden = True
wsSheet.Columns("AI:AI").EntireColumn.Hidden = True
wsSheet.Rows("77").EntireRow.Hidden = True
wsSheet.Rows("80").EntireRow.Hidden = True
Else
wsSheet.Columns("C:C").EntireColumn.Hidden = False
wsSheet.Columns("AI:AI").EntireColumn.Hidden = False
wsSheet.Rows("77").EntireRow.Hidden = False
wsSheet.Rows("80").EntireRow.Hidden = False
End If
End Sub
Vložiť do modulu
Sub Skryt()
Dim wsSheet As Worksheet, bSkyt As Boolean
For Each wsSheet In ThisWorkbook.Worksheets
With wsSheet
bSkyt = .Columns("C:C").EntireColumn.Hidden = False
.Range("C1,AI1").EntireColumn.Hidden = bSkyt
.Range("A77,A80").EntireRow.Hidden = bSkyt
End With
Next wsSheet
End Subcitovat