View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default UserForm remembering Settings

Jason,

The setting would have to be stored somewhere, such as in a worksheet cell,
a defined name, or in the system registry. You can use SaveSetting to store
the check box state in the registry when the form is closed, and then use
GetSetting to retrieve the setting when the form is initialized. For
example,

Private Sub UserForm_Initialize()
Me.CheckBox1.Value = CBool(GetSetting("AppName", "Setup", _
"CheckBox1State", "False"))
End Sub

Private Sub UserForm_Terminate()
SaveSetting "AppName", "Setup", "CheckBox1State", _
Format(Me.CheckBox1.Value)
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"jason" wrote in message
om...
Is it possible for a checkbox on a userform to be saved in the last
setting that the user left it in, when the user closes and saves the
workbook - without using any worksheet cells.