Call procedure using variable

G

Guest

I need use an expression, which has been derived as a variable in a code
procedure, to call a Subroutine of the same name.
The Sub Routine will have a name eg MyZ7 derived from:-
MyName="My" & Range("A1").Value where A1 contains "Z7"
this produces "MyZ7" OK but the problem is that if I now write:-
"Call MyName" I get an error message "Compile Error expected Procedure not
Variable"
There must be a way around this: help please
 
D

Dave Peterson

One way:

application.run thisworkbook.name & "!" & myname

Is Thisworkbook ok?
 

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