#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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" (notmorespam) wrote in message
...

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default 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" (notmorespam) wrote in message
...

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
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
stop running code lou sanderson Excel Programming 0 November 29th 05 07:21 PM
Why does code execution stop? HELP! Damian Excel Programming 2 February 16th 05 06:41 PM
Using code to stop a macro. Wrightr Excel Programming 1 September 2nd 04 11:10 PM
stop code execution al ramirez Excel Programming 1 August 26th 04 03:45 AM


All times are GMT +1. The time now is 02:17 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"