Anne Troy
asked on
Copy from 3 CSV files into one worksheet
The solutions I'm finding when I search the web always throw in a bunch of other stuff I don't need, but require interaction. I'm trying to make this a one-click process.
This is just part one.
Open each of 3 csv files, we can call them A.csv, B.csv, and C.csv. They can be opened one at a time or all at once.
Copy from A2:C2 and down.
Then paste into the workbook called Macro.xlsm, which happens to be open.
Paste to Data!D2.
The other 2 files should paste below that. Note there are blank rows in the CSV files.
Sample project files can be found at www.annetroy.com/eeq
I do not want to have to designate a path name. I would like for the code to use "this folder". The macro.xlsm workbook and CSV files will always be in the same folder.
I will be watching my email in case you have any questions.
I will be posting another question as soon as I've got this one done. I thank you so much in advance for your time!
This is just part one.
Open each of 3 csv files, we can call them A.csv, B.csv, and C.csv. They can be opened one at a time or all at once.
Copy from A2:C2 and down.
Range(Range("A2:C2"), Range("A2").End(xlDown)).Copy
Then paste into the workbook called Macro.xlsm, which happens to be open.
Paste to Data!D2.
The other 2 files should paste below that. Note there are blank rows in the CSV files.
Sample project files can be found at www.annetroy.com/eeq
I do not want to have to designate a path name. I would like for the code to use "this folder". The macro.xlsm workbook and CSV files will always be in the same folder.
I will be watching my email in case you have any questions.
I will be posting another question as soon as I've got this one done. I thank you so much in advance for your time!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ChDir ActiveWorkbook.Path
before opening the files.