LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default If statement in Auto_Open

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

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

I've tried this:

If (Sheet1)A:1 = "Hello"
Then
Range("A1").Select
Else
Macro1
End If

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

Any ideas?

Kind regards

Ian M
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
AUTO_OPEN Bob Barnes Excel Discussion (Misc queries) 2 February 6th 08 03:03 AM
Auto_open and more.... pcor New Users to Excel 2 December 1st 06 02:07 AM
Auto_open and more.... Mike New Users to Excel 0 November 30th 06 07:13 PM
Auto_open dan Excel Discussion (Misc queries) 7 May 21st 06 10:41 AM
Beyond AUTO_OPEN WarrenR Excel Programming 2 February 27th 04 03:57 AM


All times are GMT +1. The time now is 10:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"