Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I am trying to have a macro that will delete any row where B is not "Pending." My code below is giving an error on line: If (cell.Value) < "Pending" Then Can you troubleshoot? Thanks. A B C D 10/18/2006 9:39 Pending 34 Local Area Activity 11/20/2006 9:44 Completed 1 Local Area Activity 11/20/2006 9:59 Pending 2 Local Area Activity Sub Only_Pending() Dim rng As Range, cell As Range, del As Range Set rng = Intersect(Range("B:B"), ActiveSheet.UsedRange) For Each cell In rng If (cell.Value) < "Pending" Then If del Is Nothing Then Set del = cell Else: Set del = Union(del, cell) End If End If Next On Error Resume Next del.EntireRow.Delete ' End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
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 |