macro for data form

stargazer

New Member
Joined
Mar 28, 2002
Messages
22
Must be dementia creeping up on me, but I cannot remember how to do a tiny 2 or 3 step macro for a button on a worksheet to open a data form for info entry for that worksheet. When creating the macro and getting the form for data layout of that sheet, working those steps, I can't close the form and then go to tools and stop the macro recording and have the macro run. Can someone please tell me what foolish step I'm missing? Thanks in advance. Bob
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
just add userform1.show to your command button click event. this will bring up your user form for data. if you have a cancel button on your user form add unload userform1 to its click event. if you have a button on your form that posts your data to the worksheet then add unload userform1 to the end of the macro.

HTH
 
Upvote 0
Private Sub CommandButton_Click()
UserForm1.Show
End Sub

Private Sub CommandButton2_Click()
UserForm1.Hide
End Sub

James
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,207
Members
448,554
Latest member
Gleisner2

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