Bonsoir,
Je voudrais effectuer des modifications par outils (colonne A).
Via l'userform, je sélectionne un outil (combobox1), je saisis en tetxbox1 et 2 et en validant je voudrais que les valeurs des textboxs se mettent en colonne B et C, pour chaque ligne de la colonne A qui sera égale au combobox1, avec ce code je n'y suis pas parvenu.
Option Explicit
Dim F As Worksheet
Private Sub UserForm_Initialize()
Dim mondico, a, i As Long
Set F = Sheets("BD")
Set mondico = CreateObject("Scripting.Dictionary")
a = F.Range("A2:A" & F.[A65000].End(xlUp).Row)
For i = LBound(a) To UBound(a)
If a(i, 1) <> "" Then mondico(a(i, 1)) = ""
Next i
Me.ComboBox1.List = mondico.keys
End Sub
Private Sub CmdValider_Click()
Dim C As Range
Application.ScreenUpdating = False
For Each C In Range(F.Cells(2, 1), F.Cells(Rows.Count, 1).End(3))
If Me.ComboBox1 <> "" Then
If C = Me.ComboBox1 Then C.Offset(0, 1) = Me.TextBox1: C.Offset(0, 3) = Me.TextBox2
Else
MsgBox "Combobox vide"
Exit Sub
End If
Next
Application.ScreenUpdating = True
Unload Me
End Sub
En vous remerciant par avance.