![]() |
Closing UserForm
I am creating a diologue box by creating a UserForm. The UserForm
automatically has a close button (X). I want to be able to change the value of a cell in the worksheet if that button is pushed. The problem is I can't seem to find where to write the code, everything I have tried has not worked. Please Help :) |
Closing UserForm
Keri,
Try this: right click on Userform and "View Code" Private Sub UserForm_Terminate() MsgBox "Userform Closed" ' add code to update your cell End Sub "Keri" wrote: I am creating a diologue box by creating a UserForm. The UserForm automatically has a close button (X). I want to be able to change the value of a cell in the worksheet if that button is pushed. The problem is I can't seem to find where to write the code, everything I have tried has not worked. Please Help :) |
Closing UserForm
Use the QueryClose event of the userform. If the X button was
used to close the form, the CloseMode will be 0. If Unload is used to dismiss the form, CloseMode will be 1. See help for QueryClose for more details. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Keri" wrote in message ... I am creating a diologue box by creating a UserForm. The UserForm automatically has a close button (X). I want to be able to change the value of a cell in the worksheet if that button is pushed. The problem is I can't seem to find where to write the code, everything I have tried has not worked. Please Help :) |
Closing UserForm
Thanks that worked great :)
"Toppers" wrote: Keri, Try this: right click on Userform and "View Code" Private Sub UserForm_Terminate() MsgBox "Userform Closed" ' add code to update your cell End Sub "Keri" wrote: I am creating a diologue box by creating a UserForm. The UserForm automatically has a close button (X). I want to be able to change the value of a cell in the worksheet if that button is pushed. The problem is I can't seem to find where to write the code, everything I have tried has not worked. Please Help :) |
All times are GMT +1. The time now is 07:28 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com