#1   Report Post  
vanjan
 
Posts: n/a
Default Find all from a list

I have data that I past into a spread sheet that I download daily of over
1000 rows with names and data columns. I have a list of 15 people listed on
this list that I need to find their records, delete the others and end up
with only those 15 peoples data. What is the best way for me to accomplish
this.
  #2   Report Post  
Ron de Bruin
 
Posts: n/a
Default

Hi

You can try this one with the names in column A
Enter all names in the array
Array("jelle", "ron", "dave")

you can also make a list on a worksheet if you want

Sub Example2()
Dim Lrow As Long
Dim CalcMode As Long
Dim StartRow As Long
Dim EndRow As Long
With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With

With ActiveSheet
.DisplayPageBreaks = False
StartRow = 1
EndRow = 1000
For Lrow = EndRow To StartRow Step -1
If IsError(.Cells(Lrow, "A").Value) Then
'Do nothing, This avoid a error if there is a error in the cell

ElseIf IsError(Application.Match(.Cells(Lrow, "A").Value, _
Array("jelle", "ron", "dave"), 0)) Then .Rows(Lrow).Delete

End If
Next
End With
With Application
.ScreenUpdating = True
.Calculation = CalcMode
End With
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"vanjan" wrote in message ...
I have data that I past into a spread sheet that I download daily of over
1000 rows with names and data columns. I have a list of 15 people listed on
this list that I need to find their records, delete the others and end up
with only those 15 peoples data. What is the best way for me to accomplish
this.



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 do I find a name in a list of names? Cat Excel Worksheet Functions 2 September 7th 05 04:47 PM
Update master list with other lists Chab Excel Worksheet Functions 0 August 4th 05 03:46 PM
How do I find data from a list (or table) and insert it in a row? Bobgolfs56 Excel Discussion (Misc queries) 1 February 3rd 05 12:51 AM
Find a duplicate value within a list? Arla M Excel Worksheet Functions 2 January 26th 05 10:04 PM
How do I find out what items are in one list but not in another l. Michelle Craig Excel Discussion (Misc queries) 2 December 22nd 04 08:32 PM


All times are GMT +1. The time now is 04:08 PM.

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"