View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
scott[_12_] scott[_12_] is offline
external usenet poster
 
Posts: 17
Default Run another macro from within this macro

Sub whchMacro()
Dim Mac2run
Mac2run = "macro" & Range("a1")
Application.Run [Mac2run]
End Sub

I was wondering about the 100 macros, how are they all differing?

Scott

On Fri, 22 Feb 2008 21:21:24 -0000, "Cathy" wrote:

A1 contains a number that changes randomly from 1 to 100
a2 reads =concatenate("Macro",A1)

Therefore A2 equals Macro1 when A1 is 1

I have written 100 macros for each of these values as I could not figure out
another way to do this. (still a little new to VB)

How do write a macro so that when it runs it refers to the cel A2 to see
which macro it is supposed to run

Thanks in advance

C