Searching and Combining Tables with Missing Entries

EngrStudent

New Member
Joined
Jul 18, 2007
Messages
4
I’m afraid I’m new to VBA and could use some coding help and advice on how to use Vlookup or another search function with missing data. I’m attempting to organize data for a work project in which I need to propagate the first data sheet in a workbook with the contents of the next 9 data sheets.

The first data sheet has a column A which consists of a sorted list of numbers corresponding to product codes. The next 9 data sheets contain a table of the product code and two or three attributes of the product. However sheets 2-10 are only partial lists of the product. For example sheet 1 contains a list of 11,800 entries then sheets 2-10 contain a compilation of those numbers with none repeated on a single sheet (for instance from 1,000 - 10,000 product codes on each sheet). Sheets 2-10 also differ amongst themselves in which product codes they do contain. And there are some blank cells in sheets 2-10. So I need to copy the info from sheets 2-10 into sheet 1 leaving blank (or another mark) where the info is absent.

Simple Example:
Sheet 1 . . . . . . . . .Sheet 2 . . . . . . . . . . . Sheet3
Prod Code . . . Prod Code | Height | Weight . . . Prod Code | Location
458 . . . . . . . . . 458 . 13 . 15 . . . . . . . . . . . 509 . B6U8
509 . . . . . . . . . 509 . 10 . __ . . . . . . . . . . . 531 . B6Y3
531 . . . . . . . . . 566 . 7 . 16 . . . . . . . . . . . . 566 . B2W4
566

Desired Outcome: Sheet 1
Prod Code | Height | Weight | Location
458 . 13 . 15 . __
509 . 10 . __ . B6U8
531 . __ . __ . B6Y3
566 . 7 . 16 . B2W4

Any suggestions? Thank very much for help in advance.
Eric
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,210
Sheet1

B2, copy across and down:
Code:
=IF(B$1="Location",VLOOKUP($A2,Sheet3!$A$2:$B$100,2,0),
   VLOOKUP($A2,Sheet2!$A$2:$C$300,IF(B$1="Height",2,3),0))
 

EngrStudent

New Member
Joined
Jul 18, 2007
Messages
4
Thank you!! A tweak of your VLOOKUP code worked well for me. And it was convenient not to need a Macro.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,168,108
Messages
5,857,431
Members
431,879
Latest member
KiwDaWabbit

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top