Voilà un petit bout de code qui dénombre le nombre de contrôles d'une UserForm, les balaye tous, et affiche le complément dudit nom quand il commence par "TextBox".
Code :
- Sub test()
- Dim monControl As Control
- MsgBox "Nombre de controles : " & UserForm1.Controls.Count
- For Each monControl In UserForm1.Controls
- If Left(monControl.Name, 7) = "TextBox" Then
- MsgBox Mid(monControl.Name, 8)
- End If
- Next
- End Sub
|
Cela devrait t'aider
Bidgii