AnyOldName
New Member
- Joined
- May 18, 2019
- Messages
- 8
I had hoped to be able to declare a variable as public in one module, assign a value to it then refer to it in other modules but as soon as I try to use it in a different module I'm getting "Compile error: Ambiguous name detected"
Module 1 Highlights
Public Var_DRPS_Code_Version As Variant
This variable is given a value from a cell on one of the sheets and can be used/referred to without problem in Module 1
Module 2
As soon as I try to refer to the variable, I get the aforementioned error message.
I hope someone can advise me on this. This code is to carry out some very repetitive tasks in updating a large data table in Excel, there are a few frequently referred to values so I had planned on reading them into variables that can then be referred to by the rest of the code as they are needed. I can come up with a work around for this particular variable but there are a few others that have evolving values and will make things a bit more complex. Should I be writing all of these values into cells somewhere then just reading them back into the code as they are needed?
Module 1 Highlights
Public Var_DRPS_Code_Version As Variant
This variable is given a value from a cell on one of the sheets and can be used/referred to without problem in Module 1
Module 2
As soon as I try to refer to the variable, I get the aforementioned error message.
I hope someone can advise me on this. This code is to carry out some very repetitive tasks in updating a large data table in Excel, there are a few frequently referred to values so I had planned on reading them into variables that can then be referred to by the rest of the code as they are needed. I can come up with a work around for this particular variable but there are a few others that have evolving values and will make things a bit more complex. Should I be writing all of these values into cells somewhere then just reading them back into the code as they are needed?