Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
hdf hdf is offline
external usenet poster
 
Posts: 30
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Return WB to original state Ronbo Excel Programming 3 January 13th 06 11:47 AM
User form in copy of original file Jennifer Excel Programming 3 April 17th 05 05:56 PM
problems with a form and a cancel button filo666 Excel Programming 1 April 13th 05 01:01 AM
Cancel Macro is user selects 'cancel' at save menu Mark Excel Programming 1 April 6th 05 05:45 PM
How do I check if a user clicked the Print Cancel button joanne Excel Programming 0 September 5th 03 08:24 AM


All times are GMT +1. The time now is 11:19 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"