Upload file by matching the names of each colums

  • Hi,

    Im trying to write an excel VBA code:
    Master file is where the file should be uploaded
    Master file has row 3 filled with the headers or Column names (examples; destination, round trip distance, so on.....)
    the file should be uploaded to this master file by browsing through the computer
    the uploading file's row 1 has same headers as row 3 of the master file (should be checked by code)...(examples; destination, round trip distance, so on.....)
    if its correct then all the values from each column of the uploading file should be filled in the same name column of the master file this code is for n number of rows


    Here is my code, what i am doing wrong
    attaching both of my files for your reference


  • I would do this by loading both tables into Power Query and Appending the data file to the Master file. No VBA code is required. Any additions to the data file automatically append when the refresh is selected.

  • External Content www.youtube.com
    Content embedded from external sources will not be displayed without your consent.
    Through the activation of external content, you agree that personal data may be transferred to third party platforms. We have provided more information on this in our privacy policy.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!