I'm sure the answer is simple, but I haven't found the right search terms to find it! So I'll just ask it here instead!
I've declared several worksheet variables as global parameters to use across several VBA subroutines:
Public ThisWS, ThatWS, TheOtherWS as Worksheet
and then set these in a global initialization routine:
Set ThisWS = ActiveWorkbook.Worksheets("This Worksheet")
I've run into a couple places where ThisWS should be set, but is not and throws an error - and I'm not sure why. Is there a way to check if ThisWS is set in the VBA code? For example, would
If ThisWS = Nothing then
work? (I haven't tried that yet - my suspicion is that it would NOT work.)
Thanks - Bill
I've declared several worksheet variables as global parameters to use across several VBA subroutines:
Public ThisWS, ThatWS, TheOtherWS as Worksheet
and then set these in a global initialization routine:
Set ThisWS = ActiveWorkbook.Worksheets("This Worksheet")
I've run into a couple places where ThisWS should be set, but is not and throws an error - and I'm not sure why. Is there a way to check if ThisWS is set in the VBA code? For example, would
If ThisWS = Nothing then
work? (I haven't tried that yet - my suspicion is that it would NOT work.)
Thanks - Bill