Dim ligne As Long, i As Integer
With Ws
If MsgBox("Confirmez-vous la modification du bailleur?", vbYesNo, "Demande de confirmation de modification") = vbYes Then
If Me.ComboBox1.ListIndex = -1 Then Exit Sub
ligne = Me.ComboBox1.ListIndex + 2
Ws.Cells(ligne, "c") = ComboBox2
Ws.Cells(ligne, "B") = ComboBox2
Ws.Cells(ligne, "A") = ComboBox1 'inutile
Ws.Cells(ligne, "O") = ComboBox4
If OptionButton1.Value = True Then
Ws.Cells(ligne, "L") = TextBox9
Ws.Cells(ligne, "M") = TextBox10
End If
For i = 1 To 9
If Me.Controls("TextBox" & i).Visible = True Then
Ws.Cells(ligne, i + 3) = Me.Controls("TextBox" & i)
Next i
End If
End With