I have many checkboxes and textboxes on my userform. I have these in groups as in, one textbox goes with two checkboxes. What I need to figure out is a short way to get the status of the checkboxes and the contents of the textbox so I can write this to a text file.
The info I will need to write to text would be any of the 25 textboxes: TextboxValue + (checkbox1 checked?) and/or (checkbox2 checked?) and so on...
Right now I only have this, but I have set approx 25 groups total, but not sure if groups are the right way to go. I hope I am making sense of this to all of you. Thanks
Dim ctrl As Control
For Each ctrl In Me.Controls
If TypeOf ctrl Is MSForms.CheckBox Then
If ctrl.GroupName = "GroupA" Then
If ctrl.Value = True Then
MsgBox ctrl.Caption & ": " & Me.TextBox1.Text
End If
End If
End If
If TypeOf ctrl Is MSForms.CheckBox Then
If ctrl.GroupName = "GroupB" Then
If ctrl.Value = True Then
MsgBox ctrl.Caption
End If
End If
End If
Next ctrl