Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have declared several constants at the top of Module1 such as:
Option Explicit Public Const BM1Left As Single = 10.1 Public Const BM2Left As Single = 20.1 Public Const BM3Left As Single = 30.1 Etc.. In the subroutine I would like to access them with a counter via concatenating the name such as: Sub Test1() Dim Counter As Integer Dim Left As Single Counter = 1 Left = "BM" & Counter & "Left" End Sub Where counter could be set by a For loop or otherwise. (So that in the above case the variable Left = BM1Left = 10.1) The above code does not work because the expression is evaluated as a string rather than the name of the Constant I want. Does anyone know how I could access the Const names similar to the "indirect" worksheet function? Thanks in advance |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Const Fails to work | Excel Programming | |||
Const Array | Excel Programming | |||
Not recognizing a Const | Excel Programming | |||
Public Const on a Drive | Excel Programming | |||
crash changing const to public const | Excel Programming |