![]() ![]() ![]() If Not IsEmpty(eData(r, 1)) Then ' not empty If ws.AutoFilterMode Then ws.AutoFilterMode = Falseĭim rg As Range: Set rg = ws.Range("A1").CurrentRegion ' has headersĭim rCount As Long: rCount = rg.Rows.Count - 1ĭim drg As Range: Set drg = rg.Resize(rCount).Offset(1) ' no headersĭim edrg As Range: Set edrg = drg.Columns(EMPTY_COL)ĭim vdrg As Range: Set vdrg = drg.Columns(VALUE_COL)ĭim r As Long, IsKept As Boolean, WasFlagged As Boolean "SOGRITA BASTIA (2020PF)", "SOGRITA SARROLA AJACCIO (2020PF)", _ĭim dict As Object: Set dict = CreateObject("Scripting.Dictionary")ĭim Key: For Each Key In DeleteStrings: dict(Key) = Empty: Next Keyĭim ws As Worksheet: Set ws = ActiveSheet ' improve! "CAT TORRES DE LA ALAMEDA (2020PF)", "CAT VALE ANA GOMES (2020PF)", _ "BALESI LOCATIONS FIGARI (2020PF)", "CAT AULNAY (2020PF)", _ "ALBIAS STELLANTIS VO (PFV)", "ATESSA ADJACENT STELLANTIS (PFV)", _ ![]() "(2020PF OLD) SPEDITION HORST MOSOLF KORNWESTHEIM", _ "(2020PF OLD) WERNER EGERLAND NEUSEDDIN", _ If IsNumeric(Application.Match(Cells(i, "K"), valeurs_a_supprimer, 0)) Thenĭelete Criteria Rows Efficiently Sub DeleteCriteriaRows()ĭim DeleteStrings(): DeleteStrings = Array( _ LastRow = Cells(Rows.Count, "K").End(xlUp).Row Valeurs_a_supprimer = Array("(2020PF OLD) WERNER EGERLAND NEUSEDDIN", "(2020PF OLD) SPEDITION HORST MOSOLF KORNWESTHEIM", "ALBIAS STELLANTIS VO (PFV)", "ATESSA ADJACENT STELLANTIS (PFV)", "BALESI LOCATIONS FIGARI (2020PF)", "CAT AULNAY (2020PF)", "CAT AVRIGNY (2020PF)", "CAT BOURGOGNE CHALON (2020PF)", "CAT BOURGOGNE DIJON (2020PF)", "CAT GUASTICCE (2020PF)", "CAT TORRES DE LA ALAMEDA (2020PF)", "CAT VALE ANA GOMES (2020PF)", "SOGRITA BASTIA (2020PF)", "SOGRITA SARROLA AJACCIO (2020PF)", "TRNAVA STELLANTIS (PFV)") 'Ajouter les valeurs que vous voulez supprimer dans le tableau 'Supprime les lignes où les cellules de la colonne K sont égales à certaines valeurs LastRow = Cells(Rows.Count, "F").End(xlUp).Row 'Supprime les lignes où les cellules de la colonne F sont vides 'Tri la colonne FĬolumns("F:F").Sort key1:=Range("F1"), order1:=xlAscending, Header:=xlYes When I halt the code, they notify me of the error. The sorting is effective, but the processing is really slow. I want to delete all of the rows in a sheet with 330000+ rows if a specified value is present in the k column fields.
0 Comments
Leave a Reply. |