+ Reply to Thread
Results 1 to 5 of 5

Vlookup on Dynamic Range

  1. #1
    Forum Contributor
    Join Date
    05-24-2012
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2007
    Posts
    113

    Vlookup on Dynamic Range

    I'm trying to find a way to perform Vlookups against a dynamic range of data, where the number of rows/values in Col B is always subject to change.

    The way that the workbook is structured is as follows:
    Sheet1: Except for Cols A & B, this is a blank sheet. This is the sheet in which the vlookup values will need to fall into based on the number found in its' Column B
    Sheet2: The sheet that contains the data that will be passed into Sheet1 via vlookup, and all of its Columns contain data.

    So, basically, Sheet1 is a shell that needs to be filled with data copied over from Sheet2 based on vlookups against Col B.

    The vlookups will need to be shifted back 1 column.
    And examples of how the Vlookups need to work is:
    • The value in Sheet2 [Col E], needs to get passed into Sheet1 [Col D]
    • Along those lines:
      The value in Sheet2 [Col F], needs to get passed into Sheet1 [Col E]
      The value in Sheet2 [Col G], needs to get passed into Sheet1 [Col F]
    • so on and so forth
    • So basically, all of the values passed into Sheet1 from Sheet2 need to be shifted back by 1 column until we reach the last Col (Col M in this file).
      Where
      The value in Sheet2 [Col M], needs to get passed into Sheet1 [Col L]

    The number of columns will remain fixed, but again the number rows will vary week to week in both of the two sheets, so I would need to have a way of creating a Vlookup through VBA that accounts for the dynamic range in Col B.

    Attached is a sample file that will hopefully make this a bit more clear.

    I would greatly appreciate any help on this!
    Attached Files Attached Files
    Last edited by hamidxa; 08-20-2014 at 01:18 PM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Vlookup on Dynamic Range

    Perhaps.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    09-18-2012
    Location
    India
    MS-Off Ver
    Excel 2007,Excel 2010
    Posts
    28

    Re: Vlookup on Dynamic Range

    Please check the attached I guess it will solve the problem
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Vlookup on Dynamic Range

    Maybe:

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    05-24-2012
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2007
    Posts
    113

    Re: Vlookup on Dynamic Range

    Thank you all for providing your solutions. These are all great!
    I landed on the solution that Norie provided, but it's helpful to see all of the different approaches as well.

    Thanks again all!

    Problem solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] VLookup using a dynamic range
    By Excelgent in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-03-2013, 01:53 AM
  2. VLookup in Dynamic Range
    By irish1two3 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-19-2007, 03:00 AM
  3. Dynamic range reference in VLOOKUP?
    By drhawk in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-09-2006, 10:21 AM
  4. vlookup in VBA (dynamic range)
    By Kayote in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-16-2006, 01:15 PM
  5. [SOLVED] Urgent Dynamic Range with Vlookup
    By Jeff in forum Excel General
    Replies: 3
    Last Post: 10-05-2005, 09:05 PM

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