Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Rokuro kubi
 
Posts: n/a
Default Ending a macro early conditionally on one cell being blank

How do I get the macro to end itself once all the data has been taken
elsewhere?

If IsEmpty("Q2") Then Exit Sub?
Else 'do nothing - it's still got data I want it to continue the macro
End If? 'here there is an error message of "End If without Block If"

  #2   Report Post  
Posted to microsoft.public.excel.misc
Kevin B
 
Posts: n/a
Default Ending a macro early conditionally on one cell being blank

How about trying:

If Range("Q2").value = "" then Exit Sub
--
Kevin Backmann


"Rokuro kubi" wrote:

How do I get the macro to end itself once all the data has been taken
elsewhere?

If IsEmpty("Q2") Then Exit Sub?
Else 'do nothing - it's still got data I want it to continue the macro
End If? 'here there is an error message of "End If without Block If"


  #3   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student
 
Posts: n/a
Default Ending a macro early conditionally on one cell being blank

Sub Macro1()
If IsEmpty(Range("Q2").Value) Then
Exit Sub
End If
End Sub
--
Gary''s Student


"Rokuro kubi" wrote:

How do I get the macro to end itself once all the data has been taken
elsewhere?

If IsEmpty("Q2") Then Exit Sub?
Else 'do nothing - it's still got data I want it to continue the macro
End If? 'here there is an error message of "End If without Block If"


  #4   Report Post  
Posted to microsoft.public.excel.misc
Rokuro kubi
 
Posts: n/a
Default Ending a macro early conditionally on one cell being blank

Great, cheers guys.

Reply
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
Compiling macro based on cell values simonsmith Excel Discussion (Misc queries) 1 May 16th 06 08:31 PM
Conditional Format as a MACRO Gunjani Excel Worksheet Functions 3 March 29th 06 05:22 PM
checking that cells have a value before the workbook will close kcdonaldson Excel Worksheet Functions 8 December 5th 05 04:57 PM
macro help thephoenix12 Excel Discussion (Misc queries) 4 July 15th 05 05:57 PM
blank cell turns to 0 LMB New Users to Excel 2 April 25th 05 03:57 PM


All times are GMT +1. The time now is 07:14 AM.

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"