[mso] Re: Excel VBA Code - Compare Lists
- From: "Tillotson, Robert N (US SSA)" <robert.tillotson@xxxxxxxxxxxxxx>
- To: <mso@xxxxxxxxxxxxx>
- Date: Thu, 26 Jun 2008 15:54:10 -0400
Herbert,
You can try this with a formula unless you are determined to go VBA.
=3DIF(ISNA(VLOOKUP(VALUE(LEFT(A1,3)),Sheet1!$A$1:$A$3,1,FALSE)),"Prohibit=
e
d Area","OK")=20
Adjust value in left to point to cell with entire post code. Adjust
number to be the same length as your part post codes.
Adjust Sheet1!$A$1:$A$3 to point to your part post codes
Adjust "Prohibited Area","OK" to say what you want.
VALUE in VLOOKUP is required if your postcodes are all numbers since
left returns a string. Not needed if you have mixed alphanumeric codes.
False is required to max exact match (returns #NA if not a match there),
sort the part post codes ascending. =20
Copy the formula down the entire column for codes to check.
Robert Tillotson
BAE-IT
Groton Field Office
860-441-2207
-----Original Message-----
From: mso-bounce@xxxxxxxxxxxxx [mailto:mso-bounce@xxxxxxxxxxxxx] On
Behalf Of Herbert Chitate
Sent: Thursday, June 26, 2008 9:03 AM
To: mso@xxxxxxxxxxxxx
Subject: [mso] Excel VBA Code - Compare Lists
Hi Folks,
I was wondering if anyone could provide me with some guidance on how I
can get round a certain problem which is as follows:
=3D20
I am trying to compare 1) a list of full postcodes, on sheet 1 against
2) a list of part postcodes on sheet 2(eg areas we can't trade in)
=3D20
Step 1) take the first postcode of (a) above, test if it is "like"
(wildcard functionality) first part postcode in (b)
Step 2) if it is not "like" the first part postcode in b, try the
postcode from (a) in step one against the next part post code in(b)
(Basically test the first postcode against all part postcodes in b
Step 3) If the full postcode in a is "like" the part post code in (b),
select active row in a and delete that row.
Step 4) After it has tested the first full postcode in (a) against all
part postcodes in (b); or after step 3, move to the next full postcode
in (a) and repeat the process i.e. test that post code against the whole
list from (b)
=3D20
I think what I am struggling with most is the criss crossing between two
sheets and activating certain cells and then moving back to the other
sheet etc.
=3D20
Many thanks for your help
=3D20
Herbert
*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx
or MicrosoftOffice@xxxxxxxxxxxxxxxx
To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
To Unsubscribe from this group, visit the group's homepage and use the
dropdown menu at the top. This will allow you to unsubscribe your email
address or change your email settings to digest or vacation (no mail).
http://www.freelists.org/webpage/mso
To be able to share files with the group, you must join our Yahoo sister
group. This group will not allow for posting of emails, but will allow
you to join and share problem files, templates, etc.:
http://tech.groups.yahoo.com/group/MicrosoftOffice . This group is for
FILE SHARING ONLY.
If you are using Outlook and you see a lot of unnecessary code in your
email messages, read these instructions that explain why and how to fix
it:
http://personal-computer-tutor.com/abc3/v28/greg28.htm
*************************************************************
*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or
MicrosoftOffice@xxxxxxxxxxxxxxxx
To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
To Unsubscribe from this group, visit the group's homepage and use the dropdown
menu at the top. This will allow you to unsubscribe your email address or
change your email settings to digest or vacation (no mail).
http://www.freelists.org/webpage/mso
To be able to share files with the group, you must join our Yahoo sister group.
This group will not allow for posting of emails, but will allow you to join
and share problem files, templates, etc.:
http://tech.groups.yahoo.com/group/MicrosoftOffice . This group is for FILE
SHARING ONLY.
If you are using Outlook and you see a lot of unnecessary code in your email
messages, read these instructions that explain why and how to fix it:
http://personal-computer-tutor.com/abc3/v28/greg28.htm
*************************************************************
- References:
- [mso] Excel VBA Code - Compare Lists
- From: Herbert Chitate
Other related posts:
- » [mso] Excel VBA Code - Compare Lists
- » [mso] Re: Excel VBA Code - Compare Lists
- [mso] Excel VBA Code - Compare Lists
- From: Herbert Chitate