Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GOTO inside a CALL Excel VBA

Status
Not open for further replies.

remeng

Technical User
Jul 27, 2006
518
US
Hi,

I have 2 different macros and I want to call a specific line in the second macro from the first. Is this possible? Is there way to perform a GOTO inside a Call?

Code:
Sub reset_control_panel_defaults()

Call default_veneer_file_name (reset_file_name) 'I want it to GOTO line reset_file_name inside the default_veneer_file name macro

End Sub

Sub default_veneer_file 

'Some Code

reset_file_name:

'Some more Code

End Sub

Thanks,

Mike
 
Avoid GoTo's (Except [tt]On Error GoTo SomeErrorHandler[/tt])

Create a new [tt][blue]Sub Reset_File_Name[/blue][/tt] and you can call it from both of your Sub's :)

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
Hi Andy,

I'd like to avoid having another macro if possible. Any other ideas? Worst case I can do another common macro.

Thanks,

Mile
 
Looks like "it's not possible to use GoTo to call code in another sub" according to this place

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
... or add argument to procedure. And mind the stack.

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top