I need to declare a lot of constants as strings made up of whatever is in the cell contents of a bunch of cells. The value of the cells in one particular sheet contain references to a lot of different workbooks, worksheets, and cell ranges. I need to declare each one of those as variables, but the variables need to stay the same whenever the other workbooks are active. I have tried
, but this reference changes depending on which workbook is open.
This doesn't work either. It gives me a "Compile Error: Constant expression required".
This also doesn't work. It just declares the constant as exactly what's in the quotes and not the cell contents. How can I get this to work?
Code:
Const WLD As String = Range("").Value
Code:
Const WLD As String = Workbooks("").Worksheets("").Range("").Value
Code:
Const WLD As String = "Workbooks("""").Worksheets("""").Range("""").Value"