Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Because it wants to test all values from criteria1 to criteria10, and I see
3 tests as simpler than 10. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "mudraker " wrote in message ... TP I don't understanf Bob's code as to why he is using left & mid string commands as your original post does not appear to be asking to match on part of what is in column l try this simpler code on a backup copy Code looks in column F if no match on "NE", "NW", "SW", "SE" looks at column L for "criteria1", "criteria2", "criteria3", "criteria4" if no match deletes entire row Private Sub DeleteRows() Dim lRow As Long ' used range is base on column A ' if a row is valid, it must have a location in column F For lRow = Cells(Rows.Count, "a").End(xlUp).Row To 1 Step -1 Select Case Cells(lRow, "F").Value Case "NE", "NW", "SW", "SE" 'do nothing Case Else Select Case Cells(lRow, "L").Value Case "criteria1", "criteria2", "criteria3", "criteria4" 'do nothing Case Else Rows(lRow).Delete End Select End Select Next lRow End Sub --- Message posted from http://www.ExcelForum.com/ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Delete Rows based on condition | Excel Discussion (Misc queries) | |||
Delete rows with date more than 48 hours with a condition.. | Excel Worksheet Functions | |||
Macro to delete rows based on a condition | Excel Worksheet Functions | |||
how do I delete all rows that match a condition? | Excel Worksheet Functions | |||
delete rows with certain condition | Excel Programming |