In Excel using VBA I can write a macro that (conceptually) looks like this:
Sub MyThing() ... let MyVariable = something ... do some stuff with MyVariable End Sub
What do I do different to pass a variable into MyThing and use it? I have a big chunk of code but I need to use it 10 times with 10 sets of variables. The only way I know how is to copy it 10 times and edit the variables. Then the code is to big to run.
I have to think this is a pretty basic question but it would sure helpme in my understanding. Please be complete!
This conversation is currently closed to new comments.
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
A VBA question, how do I?
Sub MyThing()
... let MyVariable = something
... do some stuff with MyVariable
End Sub
What do I do different to pass a variable into MyThing and use it? I have a big chunk of code but I need to use it 10 times with 10 sets of variables. The only way I know how is to copy it 10 times and edit the variables. Then the code is to big to run.
I have to think this is a pretty basic question but it would sure helpme in my understanding. Please be complete!