The best solution here is to rename your textboxes with a little prefix like
this:
"grp1TextBoxName"
Then you can run 1 loop that adds up textbox values based on that prefix:
Sub Example()
' Create variables
Dim dSum1 As Double
Dim dSum2 As Double
Dim dSum3 As Double
Dim ctrl As MSForms.Control
' Loop through controls looking for text boxes
For Each ctrl In Me.Controls
If TypeOf ctrl Is MSForms.TextBox Then
If InStr(ctrl.Name, "grp1") <> 0 Then
' Add to group 1 total
' Remove first letter from text box value
dSum1 = dSum1 + Right(ctrl.Text, Len(ctrl.Text) - 1)
ElseIf InStr(ctrl.Name, "grp2") <> 0 Then
' Add to group 2 total
' Remove first letter from text box value
dSum2 = dSum2 + Right(ctrl.Text, Len(ctrl.Text) - 1)
ElseIf InStr(ctrl.Name, "grp3") <> 0 Then
' Add to group 2 total
' Remove first letter from text box value
dSum3 = dSum3 + Right(ctrl.Text, Len(ctrl.Text) - 1)
End If
End If
Next ctrl
' Copy totals to labels
With Me
.label1.Value = dSum1
.label2.Value = dSum2
.label3.Value = dSum3
End With
End Sub
The code finds all textboxes, checks their name for either "grp1", "grp2",
or "grp3", and then adds up totals based on that naming convention.
Hope this helps,
Matthew Pfluger