Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cancel Button in User Form does not rever to original state
I have a User Form with five check boxes. The default setting for the
check boxes is FALSE. When I open the user form and select some of them and then hit the CANCEL commandbutton (the idea being that I dont want to make any changes afterall), the cells chosen as the ControlSoruce retain the TRUE value. What I want it to do is for it to return to the state the check boxes had when the User Form was open - whether that be TRUE or FALSE. While the default state is false, in some cases selections may have been made previously. The code associated to the Cancel Button is: Private Sub cb_Cancel_Click() Unload Me End Sub I thought that this was the code to use to achieve cancel any actions taken on a user form. Obviously not. What do I need to do? Thank you. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cancel Button in User Form does not rever to original state
No, it just fires the event you program to take the actions you want.
So in the Initialize event, gather the values in the cells and store them in a module level variable(s). In the cancel event, restore those values by writing them back to the cells (or work with the checkboxes - your choice. -- Regards, Tom Ogilvy wrote in message oups.com... I have a User Form with five check boxes. The default setting for the check boxes is FALSE. When I open the user form and select some of them and then hit the CANCEL commandbutton (the idea being that I dont want to make any changes afterall), the cells chosen as the ControlSoruce retain the TRUE value. What I want it to do is for it to return to the state the check boxes had when the User Form was open - whether that be TRUE or FALSE. While the default state is false, in some cases selections may have been made previously. The code associated to the Cancel Button is: Private Sub cb_Cancel_Click() Unload Me End Sub I thought that this was the code to use to achieve cancel any actions taken on a user form. Obviously not. What do I need to do? Thank you. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cancel Button in User Form does not rever to original state
Thank you. I know exactly what to do now.
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Return WB to original state | Excel Programming | |||
User form in copy of original file | Excel Programming | |||
problems with a form and a cancel button | Excel Programming | |||
Cancel Macro is user selects 'cancel' at save menu | Excel Programming | |||
How do I check if a user clicked the Print Cancel button | Excel Programming |