Wild card characters in variable names

davidam

Active Member
Joined
May 28, 2010
Messages
474
Office Version
  1. 2021
Platform
  1. Windows
Hi All,
I have a userform that, when completed, will generate about 16 variables. The variables are named the same except that each one has a different number as the last character.
When the form is closed it calls a procedure that acts based upon changes to these variables (mostly Boolean). The procedure checks a range of values, with a Do Loop, and then makes changes accordingly. There does not seem to be any way to use the same Do Loop by changing the variable name with a wild card. Do I have build a whole series of Do Loops, or can I use one and change the variables with a wild card somehow?
Thank you
David
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Sample code would help others to help you, otherwise suggestions can only be vague.
How about loop counter instead?
For i = 1 to 16
....'do something with var & i
Next
 
Upvote 0
Sample code would help others to help you, otherwise suggestions can only be vague.
How about loop counter instead?
For i = 1 to 16
....'do something with var & i
Next
Hello Micron,
Thank you for the reply. I have been digging around and trying different things and think that what I am trying to do is just not possible. I have created a sheet level interface which is a satisfactory solution to my problem. Again, thank you for the reply.
David
 
Upvote 0

Forum statistics

Threads
1,215,220
Messages
6,123,693
Members
449,117
Latest member
Aaagu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top