-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhidingShowing
More file actions
32 lines (28 loc) · 1.18 KB
/
hidingShowing
File metadata and controls
32 lines (28 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Attribute VB_Name = "hidingShowing"
Sub Makro6()
'
' Hiding / showing the columns of authors, ilustrator etc.
'
Dim stlpce As Range
Dim stlpce2 As Range
Dim X As String
If ActiveSheet.Name = "Knihy_L'uboš" Then
Worksheets("Knihy_L'uboš").Activate
X = "Knihy_L'uboš"
End If
If ActiveSheet.Name = "Knihy_Žanetka" Then
Worksheets("Knihy_Žanetka").Activate
X = "Knihy_Žanetka"
End If
Set stlpce = ThisWorkbook.Worksheets(X).Range(AUTHORS_COLUMN) 'select columns of authors
Set stlpce2 = ThisWorkbook.Worksheets(X).Range(ILUSTRATOR_COLUMN) 'and ilustrator
If stlpce.EntireColumn.Hidden = False Then 'if they are not hidden,
stlpce.EntireColumn.Hidden = True 'hide them and
stlpce2.EntireColumn.Hidden = True
Worksheets(X).Buttons("Button 5").Caption = "Zobraz ïalšie role" 'change label of button
ElseIf stlpce.EntireColumn.Hidden = True Then 'if they are hidden...
stlpce.EntireColumn.Hidden = False
stlpce2.EntireColumn.Hidden = False
Worksheets(X).Buttons("Button 5").Caption = "Skry ïalšie role"
End If
End Sub