Euro5
asked on
VBA add csv to existing worksheet using file explorer
I have a weekly report that will add csv files to the existing workbook. I will likely use a button to run the process.
I would like for the code to open the file explorer so the user could choose which csv file to import and then add that file to the first blank row in the the sheet 'ur data'.
Can anyone help? Thank you!
I would like for the code to open the file explorer so the user could choose which csv file to import and then add that file to the first blank row in the the sheet 'ur data'.
Can anyone help? Thank you!
ASKER
I am getting an error - Run-time error '1004'
Can I ask you to change this slightly?
Could it just pull in the ur.csv file (from the current folder), and add it to the first blank line in the sheet 'ur data'?
Not sure if that is easier or harder! Thank you!
Can I ask you to change this slightly?
Could it just pull in the ur.csv file (from the current folder), and add it to the first blank line in the sheet 'ur data'?
Not sure if that is easier or harder! Thank you!
I am getting an error - Run-time error '1004'Wich line throw the error ?
Could it just pull in the ur.csv file (from the current folder), and add it to the first blank line in the sheet 'ur data'?Can you upload your CSV file ?
The file structure might differ on my system.
ASKER
This-is-the-workbook.xlsx
Fabrice,
I uploaded a workbook and a csv. This would be a good example of what I need to achieve.
The csv needs to compile at the end of the existing data. The file will always be called ur.
I would like to have it run the subroutine to complete this.
I really appreciate your help!
ur.csv
Fabrice,
I uploaded a workbook and a csv. This would be a good example of what I need to achieve.
The csv needs to compile at the end of the existing data. The file will always be called ur.
I would like to have it run the subroutine to complete this.
I really appreciate your help!
ur.csv
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
als315 - thank you!! This is working great to pull in the file!
2 changes if possible?
It is pulling in the header from the csv - can we not include that?
Can we not use the picker and just pull in the file ur.csv?
I really appreciate your help!
2 changes if possible?
It is pulling in the header from the csv - can we not include that?
Can we not use the picker and just pull in the file ur.csv?
I really appreciate your help!
ASKER
I figured it out! Thank you!
Open in new window
side note:Adjust the ImportCSV function to fit your needs