Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 :) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 :) |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 :) |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 :) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Userform won't show after closing another file | Excel Discussion (Misc queries) | |||
closing userform automatically | Excel Programming | |||
closing a userform | Excel Programming | |||
Vba - automaticaly closing userform | Excel Programming | |||
Help with closing a UserForm | Excel Programming |