+ Reply to Thread
Results 1 to 4 of 4

Dynamic vlookups through vba

  1. #1
    Registered User
    Join Date
    04-09-2015
    Location
    delhi
    MS-Off Ver
    7
    Posts
    15

    Dynamic vlookups through vba

    Hello

    I have two files: an input file and output file. I want to apply vlookups in 16 columns from the input file into the output file.

    I have written a code in which i am first copying the input data into the output file and then applying the vlookups. I am facing an issue in making the vlookups dynamic.

    For example, I want to change the lookup value (rows) and the columns in which the formula is being applied.

    I tried to make it dynamic using a loop and incrementing the values, but did not have much luck.

    Any help would be appreciated. Files attached for reference.

    Input file name: Input File
    Output file name: FY20Q4_Spend_Sponsorships
    Sheet in which lookups to be executed: Dynamics Tracker
    Input sheet where data is being pasted: Data sheet

    Column references are updated in the first row of the Dynamics Tracker sheet for reference.
    Attached Files Attached Files

  2. #2
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,709

    Re: Dynamic vlookups through vba

    Hi sahilkh18,

    The below code should yield the same expected results but much faster than using vlookup. In case the 1st row in "Dynamics Tracker" sheet will be deleted, make sure to decrease the highlighted in red numbers by 1 below

    Please Login or Register  to view this content.
    If I was able to help, you can thank me by clicking the * Add Reputation under my user name

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,368

    Re: Dynamic vlookups through vba

    Administrative Note:

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. No help to be offered until the link is provided.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Registered User
    Join Date
    04-22-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Dynamic vlookups through vba

    Great! very helpful

+ 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. Vba vlookups
    By Kiichiro in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-10-2016, 06:54 AM
  2. Dynamic VLookups in Pivots
    By ebs5075 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 08-17-2015, 02:03 PM
  3. Dynamic Chart which has VLookups
    By burgie10 in forum Excel General
    Replies: 4
    Last Post: 04-23-2015, 04:33 PM
  4. Help with dynamic formula including OFFSET and VLOOKUPs
    By rifeca88 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-20-2015, 04:52 AM
  5. [SOLVED] Adding dynamic vlookups across multiple sheets
    By rsadambrown in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-23-2014, 09:58 AM
  6. Dynamic Vlookups?
    By somehowsomeway in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-20-2013, 06:21 PM
  7. Dynamic Named Range, COUNTIFs & VLookups
    By pmd in forum Excel General
    Replies: 7
    Last Post: 05-31-2010, 08:57 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