Variable procedure call

G

Guest

Hi,

Does anyone know if I can, during runtime, call a procedure with a variable
name? For example, I'd like to pass a parameter to a calling procedure, and
then based on that parameter call another procedure. I'm sure I cheat and do
it with a select statement, but I'd like to do it more directly if possible.

Thanks,

Art
 
D

Dave Peterson

dim myStr as string
mystr = "Sub1"
application.run "'" & thisworkbook.name & "'!" & mystr
 
G

Guest

Dave - FANTASTIC!

I really needed to do this, but frankly thought it couldn't be done. I
figured I had nothing to lose by asking. This is great! This will really
simplify a bunch of stuff in my application.

Thanks,

Art
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top