M
Minitman
Greeting,
I am confused over how to make a variable to be variable.
I am running Office 2003 on an XP Pro machine
I have a set of 21 variables called Rng1, Rng2, ... Rng21. these
variable are equal to named ranges on a sheet. So far so good.
I am trying to eliminate the use of select case in this procedure. It
appears that I have the syntax wrong.
Here is one of the case statements:
Sub DoThis(iArg as Integer)
Select Case iArg
....
Case 6
Set rRng = Rng6
Set cmBox = TB6
....
I tried:
Set rRng = Range("Rng" & iArg)
And got the following error on this line:
Run-time error '1004':
Method 'Range' of object '_Global' failed.
The Rng's are dimmed as Range.
Anyone have any idea what I did wring? Or on how to fix it?
Any help is appreciated.
-Minitman
I am confused over how to make a variable to be variable.
I am running Office 2003 on an XP Pro machine
I have a set of 21 variables called Rng1, Rng2, ... Rng21. these
variable are equal to named ranges on a sheet. So far so good.
I am trying to eliminate the use of select case in this procedure. It
appears that I have the syntax wrong.
Here is one of the case statements:
Sub DoThis(iArg as Integer)
Select Case iArg
....
Case 6
Set rRng = Rng6
Set cmBox = TB6
....
I tried:
Set rRng = Range("Rng" & iArg)
And got the following error on this line:
Run-time error '1004':
Method 'Range' of object '_Global' failed.
The Rng's are dimmed as Range.
Anyone have any idea what I did wring? Or on how to fix it?
Any help is appreciated.
-Minitman