ClimoC
Well-known Member
- Joined
- Aug 21, 2009
- Messages
- 584
So a Const/#Const only work as Private compiler constants... ie, for the module within which they reside.
Can I have a Public compiler constant at all?
Essentially, before every script in my 20 modules and forms runs, I want it to obtain the value from Sheet3, Cell E2
I would've thought #Const SecLvl = Sheets("GridData").Range("E2").Value or a variation thereof would work, but apparently not. Unrecognised, invalid, wrong syntax, you name it, I've gotten an error for it.
Any help as to how I can do this? Or do I have to Global my integer and then set the value at runtime with a line like 'SecLvl = Sheets("GridData").Range("E2").Value' etc
Thanks
C
Can I have a Public compiler constant at all?
Essentially, before every script in my 20 modules and forms runs, I want it to obtain the value from Sheet3, Cell E2
I would've thought #Const SecLvl = Sheets("GridData").Range("E2").Value or a variation thereof would work, but apparently not. Unrecognised, invalid, wrong syntax, you name it, I've gotten an error for it.
Any help as to how I can do this? Or do I have to Global my integer and then set the value at runtime with a line like 'SecLvl = Sheets("GridData").Range("E2").Value' etc
Thanks
C