+ Reply to Thread
Results 1 to 4 of 4

Ending a macro early conditionally on one cell being blank

  1. #1
    Rokuro kubi
    Guest

    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. #2
    Kevin B
    Guest

    RE: 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. #3
    Gary''s Student
    Guest

    RE: 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. #4
    Rokuro kubi
    Guest

    Re: Ending a macro early conditionally on one cell being blank

    Great, cheers guys.


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1