+ Reply to Thread
Results 1 to 3 of 3

Stop Code

Hybrid View

  1. #1
    achidsey
    Guest

    Stop Code


    Excel Experts,

    I want to stop my procedure if the first sub procedure finds a cell that is
    empty. I have been able to make my code exit the first sub procedure when it
    finds the empty cell, but the code then resumes with the second sub procedure.

    Is there a way I can make the whole procedure stop.

    My code is similar to the following:

    Sub RunCheckBlankAndProcess()

    CheckBlank
    Process1
    End Sub


    Sub CheckBlank()

    Set FirstRow = Cells.Find(What:="SymSide").Offset(1)

    If IsEmpty(FirstRow) = True Then

    Exit Sub

    End If

    End Sub


    Sub Process1()

    (Process 1 Code)
    End Sub


    Thanks,
    Alan

    --
    achidsey

  2. #2
    Tom Ogilvy
    Guest

    Re: Stop Code

    Sub RunCheckBlankAndProcess()

    if CheckBlank Then Exit sub
    Process1
    End Sub


    Function CheckBlank()

    Set FirstRow = Cells.Find(What:="SymSide").Offset(1)

    CheckBlank = IsEmpty(FirstRow)

    End Function


    --
    Regards,
    Tom Ogilvy


    "achidsey" <[email protected](notmorespam)> wrote in message
    news:[email protected]...
    >
    > Excel Experts,
    >
    > I want to stop my procedure if the first sub procedure finds a cell that

    is
    > empty. I have been able to make my code exit the first sub procedure when

    it
    > finds the empty cell, but the code then resumes with the second sub

    procedure.
    >
    > Is there a way I can make the whole procedure stop.
    >
    > My code is similar to the following:
    >
    > Sub RunCheckBlankAndProcess()
    >
    > CheckBlank
    > Process1
    > End Sub
    >
    >
    > Sub CheckBlank()
    >
    > Set FirstRow = Cells.Find(What:="SymSide").Offset(1)
    >
    > If IsEmpty(FirstRow) = True Then
    >
    > Exit Sub
    >
    > End If
    >
    > End Sub
    >
    >
    > Sub Process1()
    >
    > (Process 1 Code)
    > End Sub
    >
    >
    > Thanks,
    > Alan
    >
    > --
    > achidsey




  3. #3
    achidsey
    Guest

    Re: Stop Code


    Tom,

    Thanks for the help.

    Alan
    --
    achidsey


    "Tom Ogilvy" wrote:

    > Sub RunCheckBlankAndProcess()
    >
    > if CheckBlank Then Exit sub
    > Process1
    > End Sub
    >
    >
    > Function CheckBlank()
    >
    > Set FirstRow = Cells.Find(What:="SymSide").Offset(1)
    >
    > CheckBlank = IsEmpty(FirstRow)
    >
    > End Function
    >
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "achidsey" <[email protected](notmorespam)> wrote in message
    > news:[email protected]...
    > >
    > > Excel Experts,
    > >
    > > I want to stop my procedure if the first sub procedure finds a cell that

    > is
    > > empty. I have been able to make my code exit the first sub procedure when

    > it
    > > finds the empty cell, but the code then resumes with the second sub

    > procedure.
    > >
    > > Is there a way I can make the whole procedure stop.
    > >
    > > My code is similar to the following:
    > >
    > > Sub RunCheckBlankAndProcess()
    > >
    > > CheckBlank
    > > Process1
    > > End Sub
    > >
    > >
    > > Sub CheckBlank()
    > >
    > > Set FirstRow = Cells.Find(What:="SymSide").Offset(1)
    > >
    > > If IsEmpty(FirstRow) = True Then
    > >
    > > Exit Sub
    > >
    > > End If
    > >
    > > End Sub
    > >
    > >
    > > Sub Process1()
    > >
    > > (Process 1 Code)
    > > End Sub
    > >
    > >
    > > Thanks,
    > > Alan
    > >
    > > --
    > > achidsey

    >
    >
    >


+ 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