View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Gig[_2_] Gig[_2_] is offline
external usenet poster
 
Posts: 6
Default Retain value of userform option button

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