The following example will store all checkbox values as names, then restore when form is re-intialised.
Option Explicit
Dim Cont As Control
Private Sub CmdBtnSave_Click()
For Each Cont In Me.Controls
If TypeName(Cont) = "CheckBox" Then
ThisWorkbook.Names.Add Name:="ChkVal_" & Cont.Name, RefersTo:=Cont.Value
End If
Next
Unload Me
End Sub
Private Sub UserForm_Initialize()
For Each Cont In Me.Controls
If TypeName(Cont) = "CheckBox" Then
On Error Resume Next
Cont.Value = Mid(ThisWorkbook.Names("ChkVal_" & Cont.Name), 2)
On Error GoTo 0
End If
Next
End Sub
Bookmarks