bonsoir a tous
ci dessous un code a 3 conditions dependante de 3 variable v1,v2,v3 v2 et v3 fonctionnent correctement mais cela ne fonctionne pas avec la variable v1 pour info dans la listbox je recupere le nom d'une societe que je stock dans la variable var21 mais avec if cela ne fonctione pas
merci si vous pouvez m'aider
Public v1, v2, v3 As String
' calcul OTD
' ligne livre a lheure et complete
Sub lgllivcomalhparcl()
Sheets("b").Select
i = 1
j = 1
v1 = var21
v2 = UserForm1.TextBox1.Value
v3 = UserForm1.TextBox2.Value
Sheets("n").Cells(1, 10).Value = v1
With Sheets("b")
Do While Cells(i, 1).Value <> ""
If .Cells(i, 7).Value >= .Cells(i, 5).Value And .Cells(i, 3).Value <= .Cells(i, 2).Value And .Cells(i, 2).Value >= CDate(v2) And .Cells(i, 2).Value <= CDate(v3) And .Cells(i, 12).Value = v1 Then
Sheets("b").Cells(i, 1).EntireRow.Copy _
Destination:=Sheets("n").Cells(j, 1)
j = j + 1
End If
i = i + 1
j = j
Loop
End With
End Sub