Can you concatenate to create dynamic variable names?

Is it possible to create a dynamic variable by concatenating a variable name with another variable name?
Here's what I'm trying to do:
I want sShatterBlade to be sShatterBlade2, then sShatterBlade3, etc where I have sShatterBlade(Cnt), with Cnt being the incremented number. It doesn't seem to work though.

      BladeNum = 5
      Cnt = 2
       While 0 < BladeNum
       Dim sShatterBlade(Cnt) As Shape
       Set sShatterBlade(Cnt) = sShatterBlade.Duplicate
       sShatterBlade(Cnt).RotateEx 45#, 3.21315, 5.305591
       BladeNum = BladeNum - 1
       cnt = cnt + 1
       Wend

Thanks,
Joseph

Parents
No Data
Reply
  • Thanks guys...It's starting to make more sense now.

    The weld inside the same sub fell right in place, but I see know what happens with the name numbering disappearing once I welded them. It did become useless. I get why you can simply add them to ShapeRange and reference them from there!
    Question though...Once the ShapeRange(ActiveSelection) is welded, and it because a single "Shape", how do you reference it? Do you have to create a new shape, such as s3 and then set it equal to the welded shapes like this?

    Dim s3 as shape
    set s3 = ActiveSelection.Weld ActiveSelection, False
Children