Thread: if macro
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default if macro

Tie Macro1 to the button

Sub Macro1()
If Activesheet.Range("A1").Value =1 Then
Macro2
ElseIf Activesheet.Range("A1").Value = 2 Then
Macro3
End If
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"choice" wrote in message
...
cell a1 can have to possible values, 1 or 2. if a1=1, when i hit a button

i want macro1 to go. if a1=2, when i hit the same button i want macro2 to
go. is this possible?