Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
compare two lists | Excel Worksheet Functions | |||
compare two lists | Excel Discussion (Misc queries) | |||
compare lists | Excel Worksheet Functions | |||
Compare two lists? | Excel Discussion (Misc queries) | |||
Compare Lists | Excel Programming |