View Full Version : Command Button To Save & Close
Mooseman60
11-19-2010, 05:39 AM
:help Hi Can anyone give me the code for a userform command button to Save data to a worksheet & Close a userform at the same time.
I have re posted this as I inadvertently posted it in the Access forum earlier
This saves the workbook and closes it
sub closewrk()
ActiveWorkbook.SaveAs Filename:= "Myname.xls"
Activeworkbook.Close False
end sub
You can create a button and assign this macro to it.
Mooseman60
11-19-2010, 06:15 AM
kroz
I don't want to close the workbook. What i have is a userform called Employees with another pop up userform to add additional Employees who aren't in the combobox on the Employee userform. What I want to be able to do is save the data entered into the popup userform to the worksheet and clear the data from the popup userform and close and return to the main Employees userform
close a user form:
try:
userformname.hide
userformname.visible = false
unload userformname
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.