Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Newb VBA question

How do you return from a sub early? I have code that looks like

If x < 5 Then
Return
End If

I get a Return without GoSub error. Coming from a C++ background so I
have no idea what is going on. Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Newb VBA question

If it is a Sub, then use Exit Sub.

If it is a function, then use Exit Function.

Rick


wrote in message
...
How do you return from a sub early? I have code that looks like

If x < 5 Then
Return
End If

I get a Return without GoSub error. Coming from a C++ background so I
have no idea what is going on. Thanks.


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
Newb VBA sub... [email protected][_2_] Excel Programming 3 October 24th 07 05:46 PM
Newb Q: XLL and XLA? Maury Markowitz Excel Programming 0 October 16th 06 05:25 PM
Extreme newb, easy question: Simple button/scrollbar coding BlackSeaBandit Excel Programming 1 August 1st 06 05:13 AM
Help a newb.... gibson00 Excel Discussion (Misc queries) 6 July 11th 06 02:21 PM
VBA newb needing help with an IF duster Excel Programming 0 June 27th 04 10:18 PM


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