makeitwork09
Technical User
I am using Excel 2007. The following code has multiple calls, however, if
the first procedure (second set of code) gets to the Exit Sub point, I do
not want the rest of the procedure calls to execute. I have looked through
a couple of books that I have and I have searched the web, but I have yet
to figure out how to get the subsequent procedure calls not to execute?
In module 1 I have the following, which, if there is an error, I do not
want the procedures after Call Module1.checkInt to execute.
Thanks in advance
the first procedure (second set of code) gets to the Exit Sub point, I do
not want the rest of the procedure calls to execute. I have looked through
a couple of books that I have and I have searched the web, but I have yet
to figure out how to get the subsequent procedure calls not to execute?
Code:
Private Sub cmdCreateCFMaturities_Click()
Call Module1.checkInt
Call Module2.CopyFilter
Call Module2.MaturitiesPivotTable
Call Module2.CashFlowPivotTable
Call MoveSheets
End Sub
In module 1 I have the following, which, if there is an error, I do not
want the procedures after Call Module1.checkInt to execute.
Code:
Sub checkInt()
Dim ValidPSA
ValidPSA = Application.InputBox(prompt:="Enter the most recent PSA",
Type:=1)
On Error Resume Next
'exit if user selects Cancel..assisted from PHV on [URL unfurl="true"]www.tek-tips.com[/URL]
thread707-1643026
If ValidPSA = False Then
Exit Sub 'I need this to be the stopping point; no more calls
should execute
Else
If IsNumeric(ValidPSA) Then
'int function rounds number, if it equals the cell, then number
is an interger
If ValidPSA > 0 And ValidPSA - Int(ValidPSA) = 0 Then
Call CashflowQuery(ValidPSA)
Else
MsgBox "Not a Positive Integer: " & ValidPSA
Exit Sub 'I need this to be the stopping point; no more
calls should execute
End If
End If
End If
End Sub
Thanks in advance