Using Booleans globally in excel vba
Posted on 2007-03-27
I am trying to set up a boolean 'HideRows' globally. Within the 'Summary' tab, CodeB hides all of the empty rows when that worksheet is activated. I don't want that code activated until after 'CodeA' is run. So what I did below is set up HideRows = False and then after CodeA is run, I set HideRows = True.
Then, in the Worksheet's code, I have an if statement saying that if HideRows = True then execute CodeB
Public HideRows As Boolean
HideRows = False
HideRows = True
'Summary Worksheet Code
Private Sub Worksheet_Activate()
If HideRows = True Then
What am I doing wrong?