Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Perform Lookup and delete non matching rows?

Can anybody help? I'm getting there but still pretty new to this and
this is my first VBA experience with lookups.

I have a s/sheet with 200 rows. I have a list (the lookup list) with a
column of 30 rows. Now, I wish to check each of the values in Column A
of the 200 rows on the first s/sheet and, if there is not a matching
entry in the lookup list column I want to delete the row.

Is lookup the best option for this or should I use multiple IF
statements?
If it is where do I start?

Thanks,

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: 3
Default Perform Lookup and delete non matching rows?

Adrian,
If I'm understanding your problem correctly, it's similar
to some I've had. Maybe there's a more elegant way, but
I've just brute-forced it with nested For..Next loops.
The outer loop would go from 1 to 200 and read in the
matching variable from your 200-member list; the inner
loop would go from 1 to 30 and read in the matchng
variable from the 30-member list. Then you use an if
statement to see if they match. If the variables are
string you have to use StrComp. Then use the outer index
to identify the row to delete. Hope this helps.
-----Original Message-----
Can anybody help? I'm getting there but still pretty new

to this and
this is my first VBA experience with lookups.

I have a s/sheet with 200 rows. I have a list (the lookup

list) with a
column of 30 rows. Now, I wish to check each of the

values in Column A
of the 200 rows on the first s/sheet and, if there is not

a matching
entry in the lookup list column I want to delete the row.

Is lookup the best option for this or should I use

multiple IF
statements?
If it is where do I start?

Thanks,

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
How do I identify matching rows of data and delete them both? WMark Excel Discussion (Misc queries) 4 October 17th 08 01:43 PM
how do I perform a lookup on an 80,000 line array? Bartimus Excel Worksheet Functions 4 June 14th 06 03:11 AM
delete all matching rows Rich Excel Discussion (Misc queries) 16 December 25th 05 02:26 AM
How do you perform a two-column lookup? Kymm Excel Discussion (Misc queries) 5 October 20th 05 05:25 PM
How to Perform Lookup on Alphanumeric Data? Damian Carrillo Excel Discussion (Misc queries) 5 May 19th 05 07:18 PM


All times are GMT +1. The time now is 10:14 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"