Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Greg -
In addition to storing the value somewhere, you also need to use the user form Initialize event to use that value (if it has been defined) to set the option buttons before you Show the user form. And, you need to use Show and Unload to trigger Initialize and QueryClose, not Hide (which won't trigger the QueryClose event). By the way, I typically use a hidden defined name (instead of a worksheet cell) to store this kind of data. - Mike http://www.MikeMiddleton.com "Gig" wrote in message ... I have a simple user form with three option buttons. I would like the value(true or false) of the option buttons to remain the same before the userform is unloaded. I thought I would store the value in a cell on the spreadsheet with the following code: Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) Sheets("sheet1").Range("f1") = OptionButton1.Value End Sub But the ob value is always false when the userform is reloaded, even though it was true when unloaded. Does anyone have a way to do this? Thanks in advance for any advice! Greg |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Populate userform combobox with option button | Excel Programming | |||
option button and userform question | Excel Programming | |||
need help on how to grey out one option button in one group box based on the selection of another option button in another group box | Excel Programming | |||
Userform retain data after closing and reopening | Excel Programming | |||
Global value does not retain value when UserForm is hide | Excel Programming |