Hi,

I have a Userform with several checkboxes on it. I have added a button "Advanced" that opens a second Userform with additional checkboxes.

What I want is for the user to be able to select specific checkboxes on the second userform and then for these to be added to the first userform which will then be resized. (The second userform is basically for advanced options that not every user will want to use. I'm trying to keep the first userform as basic as possible but allow more advanced users to add options to it).

I found some code that adds checkboxes / resizes a userform based on the number of visible worksheets, but I can't figure out how to rework it to do the same based on checkboxes (I'm pretty new to VBA):

Private Sub UserForm_Initialize()
For Each c In ThisWorkbook.Worksheets
    If c.Visible = True Then
        Set TempValue = Me.Controls.Add("Forms.CheckBox.1", c.Name)
        With Me.Controls.Item(c.Name)
          .Top = I
          .Caption = c.Name
          .Width = 150 
        End With
        I = I + 20
    End If
Next
Me.Height = I + 30
Me.Width = 150
End Sub
Any help will be greatly appreciated.

Cheers,
Gareth