Declaring a Constant
I understand how to declare a Public Constant and set its value eg . . .
Public Const <name> as String = <value>
However I want to define the value as a concatenated string eg . . .
Public Const <name> as String = "C:\Users" & Environ$("username") & "\OneDrive"
. . . but this fails with "Compile error".
I can get round this by just declaring the constant's name, then setting its value in the Auto-Open macro.
I was wondering if there is a better or neater way to do this ?
|