Add Data then close userform

Cruizer67

New Member
Joined
Jan 17, 2005
Messages
31
How can I get it to close the window(userform) after taking the information and adding it to the spread sheet.. as it is now I have oit so that they have to press the close buttom..

This is the add button

Private Sub Add_Click() This adds the info of course..

after that they have to press this to close userform..

Private Sub Cancel_Click()
Unload Me
End Sub


I'd like to close the userform automatically after pressing the add button and it inputs the data

any ideas please?
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Just put Unload Me after the code that adds the data to the sheet in your Add_Click code.

You may still want to leave the close button in case someone doesn't want to update at that time.

HTH,

Smitty
 
Upvote 0

Forum statistics

Threads
1,214,588
Messages
6,120,412
Members
448,959
Latest member
camelliaCase

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