Thread: MACRO?
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Per Jessen Per Jessen is offline
external usenet poster
 
Posts: 1,533
Default MACRO?

Hi

Look at this code.

Sub CLEARall()
Range("A1").Value
If Range("A1").Value= 1 Then
Application.Run "One"
ElseIf Range("A1").Value= 2 Then
Application.Run "Two"
ElseIf Range("A1").Value = 3 Then
Application.Run "Three"
End If
End Sub

Regards,
Per

"Neil Pearce" skrev i meddelelsen
...
All,

Is there anything obviously wrong with the below? Only it always runs
applictaion three regardless of the value in A1.

Sub CLEARall()

If A1 = 1 Then
Application.Run "One"
ElseIf A1 = 2 Then
Application.Run "Two"
Else: A1 = 3
Application.Run "Three"
End If


Thanking-you,

Neil