Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Was given this code, but doesnt work. It deletes everything.
The data on the worksheet was imported - i think this has something to do with the reason it doesnt work (or filter) properly. Sub DeleteRows() Dim LastRow As Long Dim rw As Long Application.ScreenUpdating = False LastRow = Cells(Rows.Count, "B").End(xlUp).Row For rw = LastRow To 2 Step -1 If Cells(rw, "B").Value < "Apples" Or Cells(rw, "B").Value < "Oranges" Then Rows(rw).Delete Shift:=xlUp End If Next rw Application.ScreenUpdating = True End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Delete & Merge Columns,Delete Rows with filter, etc | Excel Programming | |||
Delete Rows if any cell in Column H is blank but do not Delete Fir | Excel Programming | |||
Copy pasting Rows, but need to Delete any Shapes/Pictures that are within copied rows | Excel Programming | |||
How to delete rows when List toolbar's "delete" isnt highlighted? | Excel Worksheet Functions | |||
Delete every 3rd row, then delete rows 2-7, move info f/every 2nd row up one to the end and delete the row below | Excel Programming |