OK, I'm cleaning up somebody else's code where the variable declarations are kind of a mess. None of the modules is Option Explicit, and there are a couple of places where the same variable is declared in multiple modules. So, my question is this: If a variable (let's call it vVar) is declared as private in the declarations of one module, and Public in another module, does the private declaration take precedence within the module it's declared in? Might be easier with an example:
VB Code:
'In Module1 Public vVar As Variant Public Sub Example() vVar = 1 Call OtherModule End SubHope that made sense.VB Code:
'In Module2 Private vVar As Variant Public Sub OtherModule() 'Is vVar 1 or empty here? End Sub




Reply With Quote