View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
robertlewis robertlewis is offline
external usenet poster
 
Posts: 8
Default combining excel worksheets with common columns

Thanks Tom
I probably should have been more detailed about my query. I have already
used the vlookup function (although thanks for the bit about getting rid of
the #N?A errors) an whilst it does work, excel runs it very slowly.
My main difficulty is that my two worksheets are the result of data
extraction which changes daily, increasing the data on each worksheet. I need
to automate the process of combining the two and have written a macro which
sort of does it but sometimes falls over because of the numbers of rows.
I have looked at the excel functions and "consolidate" may work but I don't
know how this operates in a macro.


"Tom Ogilvy" wrote:

use the vlookup worksheet function in Sheet1.

See Excel help for details.

in E2 of sheet1:
=if(iserror(match(A2,Sheet2!A:A,0)),"",vlookup(A2, Sheet2!A:B,2,0))

drag fill down column E.

--
Regards,
Tom Ogilvy

"robertlewis" wrote in message
...
I am using Excel 2003have 2 worksheets, one with a full list of job data
(one
record per row) and the other with similar data but only a sub-set of the
first, where one column is common to both worksheets. I want to copy the
columns from the second worksheet onto the first one but only when the
common
data matches (in this case a unique number).
Example:
Sheet1 headings: job_no, name, date, address
Sheet2 headings: job_no, status
Result needed: job_no, name, date, address, status