View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chris Chris is offline
external usenet poster
 
Posts: 244
Default If statement in Auto_Open


If Sheets("Sheet1").Range("A1") = "Hello" The
Range("A1").Selec
Els
Macro
End I

----- Ian M wrote: ----

When an Excel Workbook opens, if cell A1 in Sheet1 contains nothing
want Excel to run Macro1

If cell A1 in Sheet1 contains the text "Hello", I want Excel to d
nothing

I've tried this

If (Sheet1)A:1 = "Hello
The
Range("A1").Selec
Els
Macro
End I

but VB gives me the red pen for the first two lines

Any ideas

Kind regard

Ian