Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Can't get out of loop at the right point

When I say quit, I don't mean I wanted to do a quit.applicatioin, since that
would exit Excel.
"Bruce Roberson" wrote in message
...
I need to know how to exit the sub in the case below in
sub submonth at the end of this section.

Basically when the IF statement here is:
If Range("Row").Value Range("DataRows").Value Then
Exit Sub

The command to "exit sub" just sends me back to the
calling sub detailloop and the command line "next" is
encountered in this situation.

Is there a command such as "quit" that allows it to not go
back to the calling sub in this case?



Sub Process_data()
Things happen here only once then
Call HeaderRecord
End Sub

Sub HeaderRecord()
Loops and Things happen here then
Call detailloop
End Sub

Sub detailloop()
looping going on here then

If Range("Row").Value Range("DataRows").Value Then
Call summonth
Else
If Range("New_Prmo") Then
Call summonth

Else
End If
End If
Next (refers to a loop that is not shown in this post)
End Sub

Sub summonth()
Range("rowsum").Value = Range("Rowsum").Value + 1
If Range("Row").Value Range("DataRows").Value Then
Exit Sub
Else
Call HeaderRecord
End If
End Sub




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
Loop Christina Excel Discussion (Misc queries) 1 March 17th 10 07:40 PM
Find loop doesn't loop JSnow Excel Discussion (Misc queries) 2 June 24th 09 08:28 PM
Data point on line is not over the point/tick in X axis... TomCat Charts and Charting in Excel 2 September 6th 07 01:36 PM
X Y Scatter With Point name on each point ? Raj Charts and Charting in Excel 3 July 27th 07 08:47 PM
I need more general XY point to point plotting than XY scatter in spazminator Charts and Charting in Excel 12 December 19th 05 05:00 PM


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

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"