Quick ?Macro short cut

cblackst

New Member
Joined
Jan 6, 2005
Messages
39
Hello All.

Is there a way I can create a macro that when a button is push the vba form will pop up on sheet1..?

Thank You.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
This should work for you>
sub shovba()
Application.VBE.MainWindow.Visible = True
end sub
 
Upvote 0
If you mean launching a UserForm, then using a button drawn on the sheet from the Control Toolbox:

<font face=Tahoma><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> CommandButton1_Click()
    UserForm1.Show
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>

HTH,

Smitty
 
Upvote 0
What's the exact error message?

If your form is really called "UserForm1" then the code above will work. Note that the code and the form name need to match exactly.

Can you post what you have?

Smitty
 
Upvote 0
Hello again..

ok, I'm still on the same program.. Is there away I can use another to print the form.

Thanks again
 
Upvote 0
Sure:

<font face=Tahoma><SPAN style="color:#00007F">Sub</SPAN> CommandButton2_Click()
    UserForm1.PrintForm
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>

Smitty
 
Upvote 0

Forum statistics

Threads
1,215,046
Messages
6,122,852
Members
449,096
Latest member
Erald

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