Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Compare two lists

You will have to muck around with this code but its solves basically the
same problem. And it could be written better. It's something I used the
other day

What you are effectively doing its a 2 stage if question.
If the surname matches then check if the firstname matches
If true then do action
You might have to create a list of surnames or use the col = fnamecol &
lastnamecol suggestion from Martin to create a unique entry.

The question I would have is that more than 2 people are going to have the
same name so you might have to check on address as well


Sub Catchment()

'finds the name of the catchment to look for
For c = 1 To 5
CatchNames = Worksheets("Area Analysis").Cells(5, 5 + c)

'range of which the catchment's are listed
For x = 6 To 137
Shire_Catch = Worksheets("Area").Cells(x, 1) ', Cells(x, 1))

'determine if the catchments are the same
If CatchNames = Shire_Catch Then
'determine the shire name
ShireName = Worksheets("Area").Cells(x, 2)
'set the range of the shire to loop through
For r = 6 To 50
Shire = Worksheets("Area Analysis").Cells(r, 3)
'determine if shire's name are the same
If Shire = ShireName Then
'copy info and paste it into the correct cell
ShireArea = Worksheets("Area").Cells(x, 3)
Worksheets("Area Analysis").Cells(r, 5 + c) = ShireArea
End If
Next r

End If

Next x
Next c

End Sub


"Jeff K." wrote in message
...
I have two Excel databases with column headers of "First Name", "Last

Name", etc. One is a master list and the second is an incomplete list. I
need to test the second list to see if the the contents of the columns
"First Name" "Last Name" in a row are contained in the first list. (These
databases have several thousand rows) If there is a match I need for there
to be a notation inserted in a column (in that row) in the first database. I
imagine this requires some kind of If/Then statement but I can't get my head
around it.

I know you folks get paid for this but I really could use your help. I am

doing this for a local civics group as a volunteer. I am not getting paid
either. Any suggestions would be helpful. 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
compare two lists lark Excel Worksheet Functions 3 May 6th 08 02:12 AM
compare two lists saman110 via OfficeKB.com Excel Discussion (Misc queries) 2 October 16th 07 05:53 PM
compare lists teejay Excel Worksheet Functions 6 September 20th 07 09:14 PM
Compare two lists? s_tyrone Excel Discussion (Misc queries) 1 November 30th 05 02:47 PM
Compare Lists David Willey Excel Programming 3 August 8th 03 03:25 PM


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