Hi everybody,
I'm newcomer into the field of VBA programming and I'm currently trying to figure out this task (for most of you probably easy to solve):
1. load UserForm with 12 checkboxes when one can check criteria he wants
2. macro should then, based on the user's option, hide/show all relevant columns containing detailed information.
Private Sub CommandButton1_Click()
For x = 1 To 12
CheckboxX = "CheckBox" & x
y = 6 + x
ActiveWorkbook.Worksheets("Zamėstnanec 1").Activate
If CheckboxX = True Then
Columns(y).EntireColumn.Hidden = False
Else
Columns(y).EntireColumn.Hidden = True
End If
Next
Unload UserForm1
End Sub
When I run the macro, it works without breaking down, but it always hide all of the columns. Could you please help me out with it?
Thank you so much for help!
Bookmarks