Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Best way to search/filter a column?

I have a s/sheet that contains in excess of 1 thousand rows. Column A
has an index I wish to use to sort and remove data and this contains
approx. 100 unique strings, of which I wish to search for approx. 30
and delete the rows that do not match any of the 30.

So, does anybody know the best way to do this?

Autofilter?
For each.. and multiple If statements?
For... and multiple If statements?
Select case statements?

I'm happy to try and work the code out (although if anybody has any to
hand that would be even better!) but just don't want to waste time
creating slow and inefficient code to start with so if anybody could
tell me which method is the best I would much appreciate it?

Regards,

Adrian



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Best way to search/filter a column?

Adrian,

I'd use the Advanced Filter. For the criteria range,
specify a range containing the list of strings you want to
filter for with the field name as the first row.

To automate this, use the macro recorder while you do it.

Cheers,
Dave
-----Original Message-----
I have a s/sheet that contains in excess of 1 thousand

rows. Column A
has an index I wish to use to sort and remove data and

this contains
approx. 100 unique strings, of which I wish to search for

approx. 30
and delete the rows that do not match any of the 30.

So, does anybody know the best way to do this?

Autofilter?
For each.. and multiple If statements?
For... and multiple If statements?
Select case statements?

I'm happy to try and work the code out (although if

anybody has any to
hand that would be even better!) but just don't want to

waste time
creating slow and inefficient code to start with so if

anybody could
tell me which method is the best I would much appreciate

it?

Regards,

Adrian



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from

http://www.ExcelForum.com/

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Best way to search/filter a column?

Please, I'm only looking for direction as to which method to follow?
I'll do the rest.

Thanks,

Adrian



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Best way to search/filter a column?

Dave, thanks but could you take a look at my releated post above and see
if you can help?

Regards,

Adrian



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Best way to search/filter a column?

How about putting that list in another worksheet.

then insert a new column that looks to see if the adjacent cell matches that
list.

=if(isnumber(match(b1,sheet2!a:a,0)),"Match","no Match")
and fill down.

(I'm not sure if the list will be the keep list or the delete list.)

Then sort your data by that column, apply data|filter|autofilter and delete the
ones you want. Then delete that helper column.

If your rows to be deleted are contiguous, then the delete will work quicker.

Kobayashi wrote:

Please, I'm only looking for direction as to which method to follow?
I'll do the rest.

Thanks,

Adrian

------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Best way to search/filter a column?

Dave,

Many thanks. I've tinkered and, taking your advice, got things
working.

Thanks again,

Adrian



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

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
search and filter Jenny Excel Worksheet Functions 5 November 27th 07 03:56 PM
Advanced filter search [email protected] Links and Linking in Excel 0 February 23rd 07 07:58 AM
Based on a condition in one column, search for a year in another column, and display data from another column in the same row look [email protected] Excel Discussion (Misc queries) 1 December 27th 06 05:47 PM
Search /Filter vertical Numeric pattern (down single column) Sam via OfficeKB.com Excel Worksheet Functions 0 July 7th 06 06:25 PM
search and filter list lokesh Excel Discussion (Misc queries) 1 May 19th 06 06:22 PM


All times are GMT +1. The time now is 12:03 PM.

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

About Us

"It's about Microsoft Excel"