1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| Sub ChercherLeFrame()
Dim FrameUsf As MSForms.Frame
Dim OptionUsf As MSForms.OptionButton
Dim I As Integer
Dim J As Integer
Dim V As Long
V = 2
With UserForm1
For I = 1 To UserForm1.Controls.Count
If TypeOf UserForm1.Controls.Item(I - 1) Is MSForms.Frame Then
Set FrameUsf = UserForm1.Controls.Item(I - 1)
For J = 1 To FrameUsf.Controls.Count
If TypeOf FrameUsf.Controls.Item(J - 1) Is MSForms.OptionButton Then
Set OptionUsf = FrameUsf.Controls.Item(J - 1)
With Sheets("BDD")
.Cells(V, 1).Value = FrameUsf.Caption
' .Cells(V, 2).Value = OptionUsf.Name
' .Cells(V, 3).Value = OptionUsf.GroupName
V = V + 1
End With
Set OptionUsf = Nothing
End If
Next J
Set FrameUsf = Nothing
End If
Next I
End With
End Sub |