View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Loading UserForm Controls (with a twist!)

Try using this UserForm_Initialize event...

Private Sub UserForm_Initialize()
Dim C As Control
For Each C In Frame1.Controls
If TypeName(C) = "CheckBox" Then
C.Value = InStr(Range("A1").Value & ";", C.Caption & ";") 0
End If
Next
End Sub

--
Rick (MVP - Excel)


"Trevor Williams" wrote in
message ...
Hi All,

I have a UserForm that contains a multipage control. Each page of the
control contains several Frames, and each Frame contains several
CheckBoxes.

Once the user has made their selection the Captions of the Checkboxes are
written to a specific Cell on the ActiveSheet, seperated with a
semi-colon.

e.g. If the user has ticked CheckBox 1, 2, and 4 in Frame1 on Page1, and
then closed the form, the Cell A1 will contain the Value "Caption 1;
Caption
2; Caption 4" (this is already in place and working.)

What I would like to do is re-load the UserForm based on the Cell Values.
When the form is re-opened the corresponding CheckBoxes will display as
TRUE

Hope that makes sense(?) -- I'm using XL2002.

Look forward to your response.

Trevor Williams