ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Canceling the rest of a Sub (https://www.excelbanter.com/excel-programming/371456-canceling-rest-sub.html)

Rob

Canceling the rest of a Sub
 
In the middle of a Sub the user is asked a question, if the user selects
Cancel I want the sub to stop. I was thinking something like this...

If DocInfo.CancelInfo = True Then
End Sub
End If

but I get an error from the above code.

Any Ideas?

Thanks in Advance.
Rob

Gary''s Student

Canceling the rest of a Sub
 
Almost the

If DocInfo.CancelInfo = True Then
Exit Sub
End If

--
Gary's Student


"Rob" wrote:

In the middle of a Sub the user is asked a question, if the user selects
Cancel I want the sub to stop. I was thinking something like this...

If DocInfo.CancelInfo = True Then
End Sub
End If

but I get an error from the above code.

Any Ideas?

Thanks in Advance.
Rob



All times are GMT +1. The time now is 04:29 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com