I have a global variable called "Start" which I set equal to the Timer so I can subtract that from the current time to record the elapsed time that a macro is running. I set this by using:
At the beginning of a sub, I define this global variable as Start = Timer. The sub goes to call another sub where the Start variable is also used. When it gets to the code within this second sub, it gives me an error called "ambiguous name detected: Start". What am I doing wrong? Am I not defining the global variable correctly? Is there a way to define the variable as a specific value globally? Do I have to put an identical Option Explicit code at the top of each module in which all subs are stored?
I appreciate the insight into this whole global variable problem.
EDIT: All subs called are actually defined as "Functions", if that matters.
Code:
Option Explicit
Public Start As Single
At the beginning of a sub, I define this global variable as Start = Timer. The sub goes to call another sub where the Start variable is also used. When it gets to the code within this second sub, it gives me an error called "ambiguous name detected: Start". What am I doing wrong? Am I not defining the global variable correctly? Is there a way to define the variable as a specific value globally? Do I have to put an identical Option Explicit code at the top of each module in which all subs are stored?
I appreciate the insight into this whole global variable problem.
EDIT: All subs called are actually defined as "Functions", if that matters.