I'm looking for some code that would search down column A and where each cell equals "N" delete the row. Thanks in advance because this forum always delivers!
Printable View
I'm looking for some code that would search down column A and where each cell equals "N" delete the row. Thanks in advance because this forum always delivers!
[vba]
Public Sub ProcessData()
Dim i As Long
Dim LastRow As Long
With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
End With
With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = LastRow To 1 Step -1
If .Cells(i, "A").Value = "N" Then .Rows(i).Delete
Next i
End With
With Application
.ScreenUpdating = True
.Calculation = xlCalculationAutomatic
End With
End Sub
[/vba]
That works wonderfully as always XLD. Thanks
How can i add another step to go to the next page named "Locations" and do the same things by deleting blank rows by going down column "B".
Add this to the sub right before you set the screen updating back to True note: this will delete all blanks in column B
[vba]Worksheets("Locations").Range("B:B").SpecialCells(xlCellTypeBlanks).EntireR ow.Delete[/vba]