For some reason I can't get this code to work. I have multiple sheets within this workbook and multiple sections where "#REF!" is found with data in between - for this reason I was told to start from the bottom up on each worksheet. I would like the code to look to column A and find any cell with 'REF!' listed and delete the whole row. I am very, very new to VBA code so I googled and found this code and can't seem to get it to work with '#REF!'. Any help would be greatly appreciated!! thank you very much!!
Sub Delete_Rows()
Dim i, LastRow
LastRow = Range("A" & Rows.Count).End(xlUp).Row
For i = LastRow To 1 Step -1
If Cells(i, "A").Value = "#REF!" Then
Cells(i, "A").EntireRow.Delete
End If
Next
End Sub
Katy
Sub Delete_Rows()
Dim i, LastRow
LastRow = Range("A" & Rows.Count).End(xlUp).Row
For i = LastRow To 1 Step -1
If Cells(i, "A").Value = "#REF!" Then
Cells(i, "A").EntireRow.Delete
End If
Next
End Sub
Katy