Good Morning all....
Got an odd one in that what I have is working, just not well....
I have a sheet with two columns and 100k plus records
Col A contains a text description that is fetched by a VBA Cut and Paste from another sheet.
In ColB I have automated a COUNTIF to copy from Row2 down to a variable called ENDROW.
This then calculates the COUNTIF, copies the data, pastes back as values and sorts first on ColB then ColA.
What I need to do is remove all rows where ColB >=2
I have the below, which works, but, it is VERY VERY slow.
<I>
Sub Delete_Extra_Rows()
Sheets("Lists").Select
Application.Calculation = xlCalculationManual
Set WS = ActiveSheet
For i = Cells.SpecialCells(xlLastCell).Row To 1 Step -1
If WS.Cells(i, 1).Value > 1 Then WS.Cells(i, 1).EntireRow.Delete
Next i
Application.Calculation = xlCalculationAutomatic
END SUB
</I>
Does anyone have any ideas how this could be improved, or, am I stuck with the time?
Any help appreciated.
Regards
DaveA
Got an odd one in that what I have is working, just not well....
I have a sheet with two columns and 100k plus records
Col A contains a text description that is fetched by a VBA Cut and Paste from another sheet.
In ColB I have automated a COUNTIF to copy from Row2 down to a variable called ENDROW.
This then calculates the COUNTIF, copies the data, pastes back as values and sorts first on ColB then ColA.
What I need to do is remove all rows where ColB >=2
I have the below, which works, but, it is VERY VERY slow.
<I>
Sub Delete_Extra_Rows()
Sheets("Lists").Select
Application.Calculation = xlCalculationManual
Set WS = ActiveSheet
For i = Cells.SpecialCells(xlLastCell).Row To 1 Step -1
If WS.Cells(i, 1).Value > 1 Then WS.Cells(i, 1).EntireRow.Delete
Next i
Application.Calculation = xlCalculationAutomatic
END SUB
</I>
Does anyone have any ideas how this could be improved, or, am I stuck with the time?
Any help appreciated.
Regards
DaveA