Suppression lignes
GIGI
-
michel_m Messages postés 18903 Date d'inscription Statut Contributeur Dernière intervention -
michel_m Messages postés 18903 Date d'inscription Statut Contributeur Dernière intervention -
Bonjour,
j'aimerai créer une macro qui me permet de supprimer tt les lignes (sur 65536) a chaque fois que j'ai un "0" ou "NA" qui s'affiche dans une colonne
Sub suprligne()
Dim iRow As Long
For iRow = ActiveSheet.UsedRange.Rows.Count To 1 Step -1
If Cells(iRow, "G").Value = "NA" Then
Cells(iRow, "D").Value = "NA" Then
Rows(iRow).Delete
End If
Next iRow
End Sub
ceci ne fonctionne pas...pouvez vs m'aider svp
Merci par avance
j'aimerai créer une macro qui me permet de supprimer tt les lignes (sur 65536) a chaque fois que j'ai un "0" ou "NA" qui s'affiche dans une colonne
Sub suprligne()
Dim iRow As Long
For iRow = ActiveSheet.UsedRange.Rows.Count To 1 Step -1
If Cells(iRow, "G").Value = "NA" Then
Cells(iRow, "D").Value = "NA" Then
Rows(iRow).Delete
End If
Next iRow
End Sub
ceci ne fonctionne pas...pouvez vs m'aider svp
Merci par avance
1 réponse
-
bonjour
essaiesApplication.ScreenUpdating = False For iRow = ActiveSheet.UsedRange.Rows.Count To 1 Step -1 If Cells(iRow, "G") = "NA" And Cells(iRow, "D") = "NA" Then Rows(iRow).Delete End If Next
Michel
Vous programmez en VBA pour Excel? Pensez D'ABORD en EXCEL avant de penser en VBA...(P. Fauconnier/dvp)