+ Reply to Thread
Results 1 to 5 of 5

Comparing Columns and Populating With Description

  1. #1
    Registered User
    Join Date
    05-01-2013
    Location
    Bartlesville, OK
    MS-Off Ver
    Excel 2010
    Posts
    3

    Comparing Columns and Populating With Description

    I am looking to build a macro that will compare a column from the master sheet against the same column in multiple sheets then if the rows match up, I'd like to pull the description on the other sheets back into the master sheet.

    I've attached a sample excel file. In the file, you can see I'm trying to pull the description from the other sheets into the master sheet by finding the table name and searching the column name.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Comparing Columns and Populating With Description

    Hi

    Master Sheet!C2: =IFERROR(VLOOKUP(B2,INDIRECT(A2&"!a:b"),2,FALSE),"") Copy down as required.

    HTH

    rylo

  3. #3
    Registered User
    Join Date
    05-01-2013
    Location
    Bartlesville, OK
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Comparing Columns and Populating With Description

    Worked perfectly, thanks!

  4. #4
    Registered User
    Join Date
    05-01-2013
    Location
    Bartlesville, OK
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Comparing Columns and Populating With Description

    Can you walk me through the logic for how it knows to grab the description? I'd like to know how it works in the event I want to use the same formula to say pull in another field like comments based on the same criterias. Thanks!

  5. #5
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Comparing Columns and Populating With Description

    Hi

    It is using the standard VLOOKUP function to find the item, and then move across to the second column and return the value found there.
    ISERROR is used so that if it doesn't find an item, it will show a blank rather than an error result
    INDIRECT is used to determine the name of the sheet that you are using, as well as the range, for the VLOOKUP. This really only worked as you have the department name available, and you have named the sheets with the same name.

    Make sense?

    rylo

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1