Hi all,
I'm using the following Macro to delete all rows that have a cell containing USD in a column range from F6 to F5000. The macro works but it only deletes a row at a time when run. Can anyone tell me how get this to loop through all rows until the end?
Thanks (Excel 2003)
Sub test()
Dim Last_Row As Long, n As Long
Application.ScreenUpdating = False
Last_Row = Range("F6:F5000").End(xlDown).Row
For n = 5 To Last_Row
If Cells(n, 6).Value = USD Then
Cells(n, 6).EntireRow.Hidden = False
Else: Cells(n, 6).EntireRow.Hidden = True
End If
Next n
Application.ScreenUpdating = True
End Sub
Bookmarks