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

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
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
 

Forum statistics

Threads
1,148,525
Messages
5,747,203
Members
424,068
Latest member
Salim khamis

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
Top