Hi guys. I'm fairly new to VBA and I'm having a small problem here. On a certain project I'm working on I have declared a couple of public Boolean variables. The value of this variable is consistent inside the same module, but if for example I change the value of Public x as Boolean to True in module1 macro1 and try to print its value in module2 macro2 the message will be empty. Any ideas?
Here's a small example:
Public macro As Boolean
__________________________
Private Sub Workbook_Open()
macro = True
.
.
End Sub
' In a different Module
Sub Test()
MsgBox macro
End Sub
The msgbox will be empty. (I used the msgbox just to illustrate the fact that the value isn't being passed on)
Here's a small example:
Public macro As Boolean
__________________________
Private Sub Workbook_Open()
macro = True
.
.
End Sub
' In a different Module
Sub Test()
MsgBox macro
End Sub
The msgbox will be empty. (I used the msgbox just to illustrate the fact that the value isn't being passed on)