Тёмный

Merge Multiple CSV Files in Excel | Excel VBA Tutorial 

Jie Jenn
Подписаться 64 тыс.
Просмотров 18 тыс.
50% 1

Опубликовано:

 

28 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 44   
@jakeliujakeliu
@jakeliujakeliu 6 лет назад
Looking online all day for this, thank you!
@jackiegilliam4944
@jackiegilliam4944 3 года назад
FABULOUS...just what I needed to complete my task! THANKS!
@shreyabiswas7590
@shreyabiswas7590 4 года назад
How can I put each csv file in different tabs of the excel workbook?
@jethrodredge9168
@jethrodredge9168 3 года назад
Good day. Thank you for the video very informative. The macros runs however it does not actually pull in the data from the csv file even though it states it has completed the merge. Any suggestions would be greatly appreciated.
@stuartopie7117
@stuartopie7117 3 года назад
Hi Jie, hoping you can help Thanks for the video/script, is there a way I can merge the files and keep the dd/mm/yy date format I received them in? When I merge it assumes US date format
@joseantoniorack3783
@joseantoniorack3783 4 года назад
I’m also getting the runtime error 1004. I copied the code exactly from your website and then made the necessary adjustments to my range. Still no idea what’s wrong.
@myronpang3228
@myronpang3228 4 года назад
Hi, very informative and thank you for the explanation. I have a question: what if my CSV files are not in the same column order and i only want to pull only some data from these CSV files to be merged in a excel table? what i want the macro to do is consolidate those data. Looking forward to hear from you!
@jiejenn
@jiejenn 4 года назад
If your columns' order are not uniform and you only want to merge few columns, my recommendation is write the VBA in a way that you copy one column at a time so your datasets will match when merging.
@ParagShah1979
@ParagShah1979 5 лет назад
Hello, Thank you for sharing the useful video on csv merge files. I have a query here, as you are merging these csv files in the excel file where you have written the macro code. We have some different requirement where we want to store all the merged csv files in new excel file which we want to share it with stakeholder. so the output of merged csv file should contain only the data and not with the macro code. I hope you understood my requirement and will share the output . Thanks, Parag
@jiejenn
@jiejenn 5 лет назад
Hi. I have done something similar in the past where you take a master excel workbook and create individual files based on a giving list. Unfortunately I currently don't have any tutorial video showing how to do that but I am planning to do one in the future.
@jayeshgaikwad3357
@jayeshgaikwad3357 4 года назад
i having some problem while runnign this vba code, im getting this error-run time error '1004', we couldn't find (xyz.csv).it is possible it was moved, renamed or deleted?. but not any issue is my folder path.... how to fix it. pl give the solution this query.thanks.
@jiejenn
@jiejenn 4 года назад
Check for typo in your script.
@heatherhironaka6141
@heatherhironaka6141 5 лет назад
I am also getting the file error, what is the typo?
@jiejenn
@jiejenn 5 лет назад
Can you post your code?
@Daniel-pt4bz
@Daniel-pt4bz 5 лет назад
I am also getting a Run Time Error 1004 referencing the line >> Set wbTemp = Workbooks.Open(Files)
@jiejenn
@jiejenn 5 лет назад
Makes sure your file name or path is correct.
@manuelgraofabra8562
@manuelgraofabra8562 4 года назад
does anyone know why I am getting each row of data separated by semicolons only in the first Column of the Merge Wks?
@mohammedziti
@mohammedziti 4 года назад
i had the issue, to add: Workbooks.Open Files, Local:=True
@oluwaniyiropo37
@oluwaniyiropo37 3 года назад
For those getting run time error or csv fine has been renamed or removed, kindly follow the process below Step 1 : Ensure that you save the excel master file as a macro-enabled file in the multiple csv files path directory. step 2: ensure that you change the file path by copying and pasting the new file path from your computer. step 3: ensure that you change the column range e.g A2: P
@JoseAdilsonJr
@JoseAdilsonJr 5 лет назад
Hi! Thanks a lot for your tutorial! I also was looking for it for hours! But unfortunately I am getting one error where the macro can find the csv files to get their names, but at the point where it would import them into the new workbook it says it can't find the file haha. The error is: "Run-time error '1004': '111_02_03_2019.csv' could not be found. Check the spelling of the file name, and verify that the file location is correct. If you are trying to open a file from your list of most recently used files, make sure that the file has not been renamed, moved or deleted." As it says the name of the file which I did not specified on the code, I know that the first part of the code is functioning perfectly. It is something about when it tries to open the files! Can you help me?
@jiejenn
@jiejenn 5 лет назад
Send me your entire VBA code to test@learndataanalysis.org. I suspect maybe there is a typo somewhere.
@JoseAdilsonJr
@JoseAdilsonJr 5 лет назад
@@jiejenn I've send u! Thank you in advance!
@jiejenn
@jiejenn 5 лет назад
@@JoseAdilsonJr Check your inbox.
@Kapucino2
@Kapucino2 5 лет назад
I believe that Dir function returns only the file name, not the entire path. I Think Workbooks.Open(Path & Files) should to the trick. You can use the name only if the files are in the default file location (CurDir - to check this path).
@joseantoniorack3783
@joseantoniorack3783 4 года назад
Hey Jose, did he end up fixing your problem? I also have the same issue
@ARJUNSINGHRAWAT
@ARJUNSINGHRAWAT 3 года назад
wonderful
@adriannip8677
@adriannip8677 4 года назад
Hey Jay, I have the same issue as multiple people in the comments about the csv file not being found. I sent you an email with my script. Could you take a look at it for me?
@jiejenn
@jiejenn 4 года назад
Usually when that happens, it is usually due to typos in the script. I'm currently busy with few projects and other things. My suggestion is to post your problem on ExcelForum.com and you should be able to find help.
@danielbosco7487
@danielbosco7487 5 лет назад
Thanks for the great video! I am having an issue with my code. My implementation is a little different (I am loading file locations from a table in a different sheet) and I keep getting a run time error: "1004" on ".Range("A2:N" & last_row).Copy" Any thoughts? Thanks.
@jiejenn
@jiejenn 5 лет назад
Looks like VBA can't find your reference source. I don't think I'm able to help with just one line of code provided.
@adrianus13
@adrianus13 4 года назад
Hi Jie, im hoping you can help. I got the script to run initially. But now get errors. The environment is on my computer's local drive (both the macro file and the csv files). The folder for the csv files is in the same folder that the macro file is in. I changed the FolderPath to the csv files folder and included the backslash at the end, and I changed the columns from N to Z in both locations. The error i keep getting is "Run-time error '1004' Sorry, we couldnt find nameofcsv.csv. Is it possible it was moved, renamed or deleted?" When I debug it highlights Set wbTemp=Workbooks.Open (Files). Hovering over that it seems to see my file...so I dont know where to go from there
@jiejenn
@jiejenn 4 года назад
Can you send me your script to RU-vid@LearnDataAnalysis.org and I'll take a look at it.
@joseantoniorack3783
@joseantoniorack3783 4 года назад
I had the same issue. How did he resolve it?
@oluwaniyiropo37
@oluwaniyiropo37 3 года назад
For those getting run time error or csv fine has been renamed or removed, kindly follow the process below Step 1 : Ensure that you save the excel master file as a macro-enabled file in the multiple csv files path directory. step 2: ensure that you change the file path by copying and pasting the new file path from your computer. step 3: ensure that you change the column range e.g A2: P
@arka2301
@arka2301 4 года назад
When I try to run this code I get an error ‘Sorry we couldn’t find “filename.csv”. Is it possible it was moved, renamed or deleted?” The files are in its place neither it has been moved nor deleted. Please advise what could be the reason.
@jiejenn
@jiejenn 4 года назад
Check your file path. Most likely your script couldn't locate the file.
@ravindrabisht7372
@ravindrabisht7372 4 года назад
Same issue here
@oluwaniyiropo37
@oluwaniyiropo37 3 года назад
For those getting run time error or csv fine has been renamed or removed, kindly follow the process below Step 1 : Ensure that you save the excel master file as a macro-enabled file in the multiple csv files path directory. step 2: ensure that you change the file path by copying and pasting the new file path from your computer. step 3: ensure that you change the column range e.g A2: P
Далее
How to Combine Multiple Excel Files using VBA
19:06
Просмотров 34 тыс.
Excel macro to combine CSV files (Using Excel VBA)
12:01
The Home Server I've Been Wanting
18:14
Просмотров 139 тыс.
3 Essential Excel skills for the data analyst
18:02
Просмотров 1,5 млн
VBA to BROWSE & COPY Data from SELECTED File in Excel
10:00