1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Dim Ws As Worksheet, Wd As Worksheet
Dim i As Long, NewLig As Long
Set Ws = Worksheets(Response) 'nom de la feuille où le contrôle doit se faire
Set Wd = Worksheets("MAJ")
i = 1 'Numéro de la première ligne à tester
With Ws
While .Range("L" & i).Value <> "" And .Range("M" & i).Value <> ""
' condition pour les clients Factures M-2
If .Range("L" & i).Value <> 0 Then
NewLig = Wd.Cells(Wd.Rows.Count, 1).End(xlUp).Row + 1
With .Rows(i)
.Interior.ColorIndex = 8 ' couleur interieur
.Font.ColorIndex = 1 ' couleur du texte
.Font.Bold = True ' mise en gras de la police
.Copy Wd.Range("A" & NewLig)
End With
End If
i = i + 1
Wend
End With |
Partager