LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default macro runs only if cell not blank

You can use an If...Then statement to control the macro.

Sub runMacro()
If Range("E3") = "" Then
Exit Sub
End If
'The rest of your macro here
End Sub



"Peterzh193 via OfficeKB.com" <u52491@uwe wrote in message
news:97b1381880940@uwe...
want a macro that refuses to run if cell E3 is blank/empty

to run the macro correcty data must be in this cell but it is user error
that
may leave it blank.....can i avoid this with a question (msgbox) as part
of a
macro?

--
Message posted via http://www.officekb.com



 
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
VBA macro runs fine, but freezes if I try to do ANYTHING else whileit runs Rruffpaw Setting up and Configuration of Excel 1 September 17th 11 01:25 PM
Macro that runs when a cell is selected Daniel Bonallack Excel Discussion (Misc queries) 3 October 6th 08 07:21 PM
blank display while macro runs RandyPerry Excel Programming 5 February 8th 08 02:33 AM
Macro runs on cell value Jeff Excel Programming 1 November 6th 06 10:19 PM
macro runs if I Clear a cell Nimzow Excel Programming 0 May 14th 05 10:15 PM


All times are GMT +1. The time now is 11:02 PM.

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

About Us

"It's about Microsoft Excel"