Q: excel userform - set/reset variable to identify/use a frame I have a number of frames on a userform and I have a set of checkboxes that contain the names of frames inside a frame ("SectorsFrame"). I want to start with "SectorsFrame", use the tag of the checkbox to identify the next frame to work with, and then repeat that step inside the next frame.
I can't get past just re-setting/renaming my frame-name variable. Any help with this?
Private Sub cmdCopy_Click()
Dim chkBox As Control
Dim cmbBox As Control
Dim frmSource As MSForms.Frame
'Dim frmSource As String
Dim valSectCopy1 As String 'to validate that a sector is filled in
Dim valSectCopy2 As String 'to validate that an antenna is filled in
Dim valPortCopy As String 'to validate that a port is filled in

Set frmSource = SectorsFrame
valSectCopy1 = ""
valSectCopy2 = ""
valPortCopy = ""


    For Each chkBox In frmSource.Controls 'Sector-level frame
        If TypeName(chkBox) = "CheckBox" And chkBox.Value = True Then
            valSectCopy1 = chkBox.Tag
            valSectCopy2 = valSectCopy1
            Set frmSource = valSectCopy1
            Exit For
        End If
    Next chkBox

This is the line that's currently throwing a tantrum:
Set frmSource = valSectCopy1

