Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default VBA Filter out unwanted records

Your column has changed from your original post and you have added the
caveat about retaining titles in row 1.

Best to stay with the original thread for continuity of replies.

Try this...........

Option Compare Text
Sub Delete_NonU_Rows()
Dim iRow As Long
Dim FirstRow As Long
Dim LastRow As Long
FirstRow = 2
LastRow = Cells(Rows.Count, "BE").End(xlUp).Row
For iRow = LastRow To FirstRow Step -1
If Left(Cells(iRow, "BE").Value, 1) < "U" Then
Rows(iRow).EntireRow.Delete
End If
Next
End Sub


Gord Dibben MS Excel MVP

On Tue, 26 Jan 2010 04:16:15 -0800, James C
wrote:

I have a list in a worksheet (named Filter) which has a number of columns
with a headings row . In Column BE (BE1 has the heading Manage1) there are
text data entires which have prefixes with a letter followed by a number. I.e
E10, V19,U23.
The list is always changing by adding more rows, so the range for column BE1
is varaiable.
I would like a VBA statement that will delete all the records in the list
where the records in column BE does not have the prefix U, but must leave the
list with it's column headings
Thanks


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to delete unwanted records TPG Excel Discussion (Misc queries) 3 November 4th 08 10:32 AM
Number of records after filter Jon Dow[_2_] Excel Worksheet Functions 2 October 1st 08 07:25 AM
Filter Unique Records Dee Excel Discussion (Misc queries) 1 June 23rd 06 09:22 PM
How can I always get subtotals (4 of 12 records)when I filter a sh Frank P. Excel Discussion (Misc queries) 1 January 25th 06 02:53 AM
Why does it say "Filter mode" instead of "X of Y records"? lucky_jed Excel Worksheet Functions 3 April 7th 05 12:05 PM


All times are GMT +1. The time now is 03:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"