Hi,
I am trying to write a piece of code that sums three cells, and then if the value of the sum is zero, delete the entire row...there will be a variable number of rows within the data, and any positive values need to be left.
I tried the below code, but it doesn't achieve my objective...any ideas very much appreciated.
Range("O7").Select
ActiveCell.FormulaR1C1 = "=RC[-2]+RC[-3]"
Range("O6").Select
ActiveCell.FormulaR1C1 = "REF 1"
a = Range("b7").End(xlDown).Row
Range("o77").AutoFill Destination:=Range("o7" & a), Type:=xlFillDefault
[o7].AutoFilter Field:=1, Criteria1:="=0"
Range([o7], [o7].SpecialCells(xlLastCell)).EntireRow.Delete
Selection.AutoFilter
I am trying to write a piece of code that sums three cells, and then if the value of the sum is zero, delete the entire row...there will be a variable number of rows within the data, and any positive values need to be left.
I tried the below code, but it doesn't achieve my objective...any ideas very much appreciated.
Range("O7").Select
ActiveCell.FormulaR1C1 = "=RC[-2]+RC[-3]"
Range("O6").Select
ActiveCell.FormulaR1C1 = "REF 1"
a = Range("b7").End(xlDown).Row
Range("o77").AutoFill Destination:=Range("o7" & a), Type:=xlFillDefault
[o7].AutoFilter Field:=1, Criteria1:="=0"
Range([o7], [o7].SpecialCells(xlLastCell)).EntireRow.Delete
Selection.AutoFilter