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
| Sub Bvalider_Click()
Dim Flm As Worksheet
Dim Plage As Range, cel As Range, firstAddress As String
Set Flm = Worksheets("mouvement")
Set Plage = Flm.Range("d2:d" & Flm.Range("d65536").End(xlUp).Row)
With Plage
Set cel = .Find(LBmoteurcadre.Value, LookIn:=xlValues, lookat:=xlWhole)
If Not cel Is Nothing Then
firstAddress = cel.Address
Do
If cel.Offset(0, 1).Value = LBmoteurcadre.Value Then
cel.Offset(0, 3).Value = Format(TBdate.Value, "dd/mm/yyyy")
cel.Offset(0, 3).Value = Format(facturevente.Value, ">")
Exit Do
End If
Set cel = .FindNext(cel)
Loop While Not cel Is Nothing And cel.Address <> firstAddress
End If
End With
facturevente.Value = ""
LBmoteurcadre.Clear
LBmodèle.Clear
CBsté.Value = ""
TBdate.Value = Format(Now, "dd/mm/yyyy")
End Sub |