Concatenate a Const Name in Sub Routine
I am creating drawing objects on the active sheet such as:
with Activesheet.Shapes
.AddShape(msoShapeRectangle, Left, Top, , 100).Name = "BM"
The drawings are created when the user clicks a paticular button on the
sheet. The click event of the button initializes the counter to the
appropriate value (1 thru 20 lets say). The drawing object would then be
placed at the appropriate "Left" position by setting
Left = "BM" &Counter &"Left"
such that if button 18 was clicked "Left" should be set equal to the value
of BM18Left. (There will also be such variables for "Top", "Width", etc) I
would like the BMxxLeft variables as Const's because that makes it much
easier to adjust them as the code progresses and changes. But either way I
do it, it would be much easier to concatenate the name as mentioned above
then to use a "IF" statement or something.
Thanks again for your help and any ideas.
"Mike H." wrote:
I tried using the evaulate function in conjunction with indirect but could
not get it to work. But if you would explain what you're trying to do,
perhaps I might have a different approach. I have not used constants at all
and have never felt like I needed to.
|