Not exactly sure, but this might be a start
In clsButton
Option Explicit
Public WithEvents CommandButtonGroup As CommandButton
Private Sub CommandButtonGroup_Click()
If (CommandButtonGroup.Name Like "CommBtnMor_#") Then
MsgBox "1 - You pressed " & CommandButtonGroup.Caption
ElseIf (CommandButtonGroup.Name Like "CommBtnNJ_?") Then
MsgBox "2 - You pressed " & CommandButtonGroup.Caption
ElseIf (CommandButtonGroup.Name Like "CommBtnCal_*") Then
MsgBox "3 - You pressed " & CommandButtonGroup.Caption
End If
End Sub
In Userform
Option Explicit
Dim Buttons() As New clsButton
Private Sub UserForm_Initialize()
Dim Ctrl As Control
Dim Count As Long
For Each Ctrl In UserForm1.Controls
If TypeName(Ctrl) = "CommandButton" Then
Ctrl.Caption = Ctrl.Name
If (Ctrl.Name Like "CommBtnMor_#") Or (Ctrl.Name Like "CommBtnNJ_?") Or (Ctrl.Name Like "CommBtnCal_*") Then
Count = Count + 1
ReDim Preserve Buttons(1 To Count)
Set Buttons(Count).CommandButtonGroup = Ctrl
End If
End If
Next
End Sub