How can I modify this Excel macro to delete a row if the A field is blank, and the B field is 0?
Posted on 2015-02-19
I want to modify this macro so that if the A field is blank, and the corresponding B field has '0' in it, or '0.00', then delete the entire row.
'Deletes the entire row within the selection if the ENTIRE row contains no data.
'We use Long in case they have over 32,767 rows selected.
Dim i As Long
'We turn off calculation and screenupdating to speed up the macro.
.Calculation = xlCalculationManual
.ScreenUpdating = False
'We work backwards because we are deleting rows.
For i = Selection.Rows.Count To 1 Step -1
If WorksheetFunction.CountA(Selection.Rows(i)) = 0 Then
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True