Here is a macro for you to try...
Sub DeleteRows()
Dim X As Long
Dim LastRow As Long
With ActiveSheet
LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row
For X = LastRow To 6 Step -1
If .Cells(X, "B").Value <> Application.Names("IDS"). _
RefersToRange Then .Cells(X, "B").EntireRow.Delete
Next
End With
End Sub
As set up, it assumes that the active sheet is the sheet you want to perform
your deletions on. If that will not always be the case, then change this
line...
With ActiveSheet
to this...
With Worksheets("Sheet1")
where you would change Sheet1 to name of the actual sheet you will want to
do the deletions on.
--
Rick (MVP - Excel)
"J.W. Aldridge" <(E-Mail Removed)> wrote in message
news:269e5d30-64f0-4fd8-9e76-(E-Mail Removed)...
> Header row a5:F5.
> Data starts at A6..
> Based on values starting in column B6 to the bottom, I would like to
> delete each row that doesnt match the values in named range "IDS".
|