Macro help PLEASE!!

  • Thread starter Thread starter Howl
  • Start date Start date
H

Howl

I'm sure this is simple but I'm rapidly running out of hair, I want to run
one of two macro based on the value in a cell. so the user would run the
macro this macro would look at the values in the cell and depending on
whether it is 0 or 2 would select a macro to run,
any help would be very much appreciated

cheers
 
Howl

Something like

Sub UserRunMacro()
With Worksheets("Sheet1")
If .Range("A1").Value = 100 Then
AutoMacro1
Else
AutoMacro2
End If
End With
End Sub

Sub AutoMacro1()
'Example only
With Worksheets("Sheet1")
.Range("A1").Value = 200
End With
End Sub

Sub AutoMacro2()
'Example only
MsgBox "The value in cell A1 on Sheet1 was not 100", vbOKOnly
End Sub


--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
 
Thanks Nick
You're a life saver, I'm sending you my first born by return post

Cheers
Howard
 
Back
Top