Hello,
I am having a bit of trouble with the VBA I have set up and wondering if some of you gurus can help me out please.
Column "L" contains the summation of the previous 5 columns and I want to delete the rows between columns A through to L if the sumation is zero (columns A through to E are text). So I have this macro that does the trick but only 1 range at the time. Also, when I put a loop I got the run time error. Could anyone pls help me to loop through many rows (variable range around 1000 rows). The current macro is:
Thank you !!!
I am having a bit of trouble with the VBA I have set up and wondering if some of you gurus can help me out please.
Column "L" contains the summation of the previous 5 columns and I want to delete the rows between columns A through to L if the sumation is zero (columns A through to E are text). So I have this macro that does the trick but only 1 range at the time. Also, when I put a loop I got the run time error. Could anyone pls help me to loop through many rows (variable range around 1000 rows). The current macro is:
Code:
Sub Macro1()
Range("L6").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-6]:RC[-1])"
lastrow = Cells(Cells.Rows.count, "a").End(xlUp).Row
Range("l6:l" & lastrow).FillDown
Calculate
lastrow = Cells(Cells.Rows.count, "a").End(xlUp).Row
Range("l6:l" & lastrow).Select
Selection.Find(What:="0", After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
True, SearchFormat:=False).Select
Range(Selection, Selection.Offset(0, -11)).Select
Selection.Delete Shift:=xlUp
End Sub
Thank you !!!