خرید بک لینک

Vote count: 0

Currently I have 10Kx15 Rows worth of raw data imported in an excel spreadsheet. I have a number of fields that are cleansed but the one of interest is a field called "Hazard". For every instance of Hazard encountered, we need to strip this out.

This is the code I use to cleanse (partially) my data set:

Sub dataCleanse()
Dim Last

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual

Last = Cells(Rows.Count, "F").End(xlUp).Row
For i = Last To 1 Step -1
    If (Cells(i, "F").Value) = "Hazard" Then
        Cells(i, "A").EntireRow.Delete
    End If
Next i

Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True

End Sub

To process 10,000 records or so it takes 10-15 seconds. I have experimented with using auto-filter, but when I use .EntireRow.Delete it strips out the rows undeeath the filtered criteria. i.e. If we have rows 1 to 3 with 'Hazard' and use auto-filter, it will also delete row2.

Are there any suggestions that could be offered to increase the speed of my macro?

Thank you!

asked 22 secs ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 24 فروردين 1395 ساعت: 13:08

صفحه بندی