Link to home
Start Free TrialLog in
Avatar of Anne Troy
Anne TroyFlag for United States of America

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.

Range(Range("A2:C2"), Range("A2").End(xlDown)).Copy

Open in new window


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
Avatar of Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs)
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Anne Troy

ASKER

That is awesome. I needed only to add:

    ChDir ActiveWorkbook.Path

before opening the files.