Return to original Subroutine

jyellis

New Member
Joined
May 3, 2006
Messages
14
I have Sub Click() the calls a Show_form that loads a form;

userform1 loads; then I want that sub userform_activate() to return back to sub Click() and run the sub Copy_All. How do I get it to return to the Sub click() and execute where it left off.

Example:
sub Click()

Show_form

Copy_All

Print_Report

unload userform1

end


Thanks in advance
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Hi,

if in your userformcode you have
Me.Hide
or
Unload Me

the code will continue after the line with
UserForm1.Show

example
Code:
Sub Click()
Show_form
Copy_All
Print_Report
Unload UserForm1
End Sub

Sub Show_form()
UserForm1.Show
End Sub

Sub Copy_All()
MsgBox "Copy_All running"
End Sub
userform code
Code:
Private Sub CommandButton1_Click()
Me.Hide
End Sub
kind regards,
Erik
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,942
Members
449,094
Latest member
teemeren

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top