If you declare a Public variable in a class module (for example a worksheet or ThisWorkbook module) then the variable may only be accessed as a member of that class. Therefore you must refer to it using syntax such as Sheet1.Variablename or ThisWorkbook.Variablename. If the variable is declared in a normal module, you may simply refer to it using its name from any other module in the workbook.
|