View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
dhstein dhstein is offline
external usenet poster
 
Posts: 266
Default Call a subroutine using variable subroutine name

Thanks Mike and Gary - that worked well.

David


"Mike H" wrote:

Try this

Application.Run Sheets("Sheet1").Range("A1").Text

Mike

"dhstein" wrote:

If I have a cell with the contents of a subroutine name for example
A1 = "Mysub"

So if I do
Dim CodeToExecute As String
CodeToExecute = Range("A1").Value

I want to call Mysub using the variable CodeToExecute

Any help is appreciated.