+ Reply to Thread
Results 1 to 3 of 3

Code to work like a Vlookup with a dynamic range

  1. #1
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    758

    Code to work like a Vlookup with a dynamic range

    Hello all,

    In Sheet2 I have a range of data, that can range from 2 to 200000.

    I have a table on Sheet8. I am matching a number in B4 on Sheet8 to a number in Column E or G (it could be in either) in Sheet2.

    I am then looking to pull in data for the 1st instance that this matched number appears in E or G and then pull in the following data:

    -Sheet2 column B into Sheet8 I4
    -Sheet2 column C into Sheet8J4


    Then similarly for the last instance that this matched number appears in E or 6 and then pull in the following:

    -Sheet2 column B into Sheet8 k4
    -Sheet2 column C into Sheet8 L4

    Any ideas?


    Many thanks,

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Code to work like a Vlookup with a dynamic range


    Hi !

    Use CurrentRegion property for example, as you can see in VBA inner help …

  3. #3
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    758

    Re: Code to work like a Vlookup with a dynamic range

    I don't understand what you mean, Im afraid...

+ 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. Set and print a dynamic range in a work sheet
    By Excel_101_Stater in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 06-05-2017, 12:06 PM
  2. [SOLVED] My code is not dynamic; it has a pre-defined range. Possible to change code?
    By mick0005 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-20-2015, 10:23 PM
  3. HI, Everyone, Desperate that Indirect function doesn't work with dynamic range
    By damiending in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-08-2015, 12:27 AM
  4. Why dynamic range doesnt work with COUNTA
    By Kushal_1991 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-31-2013, 11:17 AM
  5. [SOLVED] Selection.AutoFill to work with dynamic range ?
    By kbriaz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-30-2013, 04:54 PM
  6. [SOLVED] combobox dynamic range doesn't work as expected
    By florin_excel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-21-2012, 09:28 AM
  7. Does this solution for non volatile dynamic named range work?
    By foxguy in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-22-2012, 01:53 AM

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