コントロール配列かどうかを判別
Private Sub Form_Load()
Dim ctl As Control
For Each ctl In Me.Controls
If TypeName(Controls(ctl.Name)) = "Object" Then
Debug.Print ctl.Name & "(" & CStr(ctl.Index) & ")"
Else
Debug.Print ctl.Name
End If
Next ctl
End Sub
'別解
Function iscontrolarray(ctl As Control) As Boolean
On Error GoTo iscontrolarray_err
Dim i As Long
i = ctl.Index
iscontrolarray = True
Exit Function
iscontrolarray_err:
If Err.Number = 343 Then
iscontrolarray = False
End If
End Function

