I have a workbook with a few modules in. Two of the modules contain nearly identical macros and constants. The names of the constants are the same although the values may differ.
Can the constants in one module have any effect on the macro in the second module even if the values to the constants are set differently in the second module?
I know it would be better to change the name of the constants but for the moment copy and paste was quick. If the naming is the problem then it’s easy to deal with. If it’s something else causing my problem then mmmm not sure what to do except keep trying.
Constants shown below
Smiler44
Can the constants in one module have any effect on the macro in the second module even if the values to the constants are set differently in the second module?
I know it would be better to change the name of the constants but for the moment copy and paste was quick. If the naming is the problem then it’s easy to deal with. If it’s something else causing my problem then mmmm not sure what to do except keep trying.
Constants shown below
Smiler44
Code:
Option Explicit 'force variables to be declared before use
Dim srcTotalsColOffset As String
'*** useful constants describing where the source data comes from
Const SourceDataSheet = "sheet1"
Const SrcRowOffset = 3 'How many Rows after the product name that the data starts
Const SrcOUCColOffset = 2 'How many columns across from the product name that the product data starts
Const OUCSigChars = 3 'How many characters for a match when comparing codes?
'*** useful constants describing where the output data goes
Const OutputDataSheet = "sheet2"
Const OutputDataOUCRow = 13 'Where we find the list of codes (running across the row)
Const OutputDataTotalRow = OutputDataOUCRow + 2 'Where we write the total for the code
Const OutputDataStartCol = 2 'First column