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
 

Some videos you may like

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,192
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.
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,595
Messages
5,512,300
Members
408,886
Latest member
kashifziatevta423

This Week's Hot Topics

  • Sort code advice please
    Hi, I have the code below which im trying to edit but getting a little stuck. This was the original code which worked fine,columns A-F would sort...
  • SUMPRODUCT with nested If statement
    Hi everyone, Hope you're all well. I'm hoping someone will be able to point me in the right direction with a problem I'm having with a SUMPRODUCT...
  • VBA - simple sort is killing me!
    Hello all! This should be so easy, but not for me, apparently! I have a table of data that can be of varying lengths and widths. My current macro...
  • Compare Two Lists
    I have two Lists and I need to be able to Identify differences between them. List 100 comes from a workbook - the other is downloaded form the...
  • Formula that deducts points for each code I input.
    I am trying to create a formula that will have each student in my class start at 100 points and then for each code that I enter (PP for Poor...
  • Conditional formatting formula required for day of week and a value
    Hi, I have a really simple spreadsheet where column A is the date, column B is the activity total shown as a number and column C states the day of...
Top