le Do while se passe dans la feuille synthese
-- 04 Juin 2010, 16:58 --
en fait Dan il y a une erreur dans le code il doit se presenter comme ci dessous j'ai omis un if......
Dim Lig As Long
Dim ws_synthese As Worksheet
Dim ws_mc As Worksheet
Set ws_synthese = Worksheets("Synthèse")
Set ws_mc = Worksheets("MC")
Lig = 6
Do While Cells(Lig, 1).Value <> ""
If ws_synthese.Cells(Lig, 1).Value = ws_mc.Cells(Lig, "G").Value Then
If ws_mc.Cells(Lig, "AA").Text = "TF-Post" Then
Lig = Lig + 1
Else
ws_synthese.Rows(Lig).Delete
End If
End If
Loop
mais j'ai ecrit celui ci qui tourne mais il y aun soucis :
Sub gautamfiltre()
Dim k As Long
Dim k_1 As Long
Dim i As Long, j As Long
Dim numero As Long
k = Worksheets("MC").Cells(Rows.Count, 7).End(xlUp).Row
k_1 = Worksheets("Synthèse").Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To k_1
If Cells(i, 2).Value Like "*AFS*" Then
numero = Cells(i, 1).Value
For j = 2 To k
If numero = Worksheets("MC").Cells(j, 7).Value Then
If Worksheets("MC").Cells(j, 27).Text = "TF-Post" Then
i = i + 1
Else
Worksheets("Synthèse").Rows(i).Delete
End If
Exit For
End If
Next
End If
Next
End Sub
il ne me suprime pas toutes les lignes de la feuille synthèse qui non pas le caracter "TF-Post"