PDA

View Full Version : Solved: macro to delete rows



Pete
12-03-2009, 03:37 AM
Hi

Need a macro to do the following steps:-

1. if column A from A6 until last cell with data in / AND

2. if column B has .00

then remove.delete whole row only. and nothing else......

Bob Phillips
12-03-2009, 04:18 AM
Public Sub PreocessData()
Dim LastRow As Long
Dim i As Long

Application.ScreenUpdating = False

With ActiveSheet

LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = LastRow To 6 Step -1

If .cels(i, "B").Value = 0 Then .Rows(i).Delete
Next i

End With

Application.ScreenUpdating = True

End Sub

Pete
12-03-2009, 04:50 AM
works prefectly just amended

If .cels(i, "B").Value = 0 Then .Rows(i).Delete

to cells

thanks for the feedback