Private Sub CommandButton1_Click() Dim Ctl As Control Dim Col As Integer, Lig As Integer Col = 1 Lig = Worksheets("Feuil4").Range("A65536").End(xlUp).Row + 1 For Each Ctl In UserForm1.Controls Select Case TypeName(Ctl) Case "TextBox": Worksheets("Feuil4").Cells(Lig, Col) = Ctl.Text Case "OptionButton": Worksheets("Feuil4").Cells(Lig, Col) = Ctl.Value Case "CheckBox": Worksheets("Feuil4").Cells(Lig, Col) = Ctl.Value Case "CommandButton1": Case "Label": GoTo Suite1 Case "Frame": GoTo Suite1 Case "Image": GoTo Suite1 End Select Col = Col + 1 Suite1: Next Ctl
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionEt je n'ai pas encore utilisé d'array dans ma vie VB, chaque année sa peine !
Txtbox73
C'est, me semble t-il la SEULE et UNIQUE solution quand on ne crée pas ses contrôles dans le bon ordre dès le début
dans ma vie VB, chaque année sa peine