Is it possible to have a 'public' variable and 'dim' variable with the same name and use both in the same sub?
The more local variable wins (shadowing).
To access the variable in the global scope you would need to qualify it with its containing module name:
Public Foo As Long
Sub g()
dim Foo As String
...
msgbox Foo
msgbox ModuleName.Foo
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments