Posts by sahilkh18

    MODERATOR NOTICE: This topic has also been posted on other sites and may already have an answer elsewhere. Please take this into consideration when answering this question


    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.

    Re: Add data from multiple workbooks into one master file.


    Since I'm a beginner.. is it possible to make some changes in the code I wrote? It would help me understand the steps a little clearly. Thank you



    Quote from royUK;749795

    Here's some code that you can adapt


    Hello


    I'm desperately in need of some help. I'm trying to create a code where


    • a new workbook (masterfile is created)
    • rename the master file to a fixed name and save it on a fixed path
    • add a set of variables to the first row
    • reference a folder where all my data files are kept
    • open each file, copy the data, paste into the master file and close the file
    • move onto the next file, repeat procedures, till there are no more files in the folder


    I have written a code for the same, but i'm unable to run the code. It skips the loop and does not copy anything from the sub files into the master file. Please assist.


    Code: