Merging multiple files together with different number of columns.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Currently I am using a batch macro process to combine files on top of each other, however each file has a different amount of columns, and my batch process only looks at matching the same column in the same space each time. Files are continuously added to the folder every day, so the merged file is updated 2x a day through the gallery.
So when the batch process runs on my files, the macro doesn’t see the same column titles to stack on top of each other, so it ends up creating new columns.
I would like to stack the same columns on top of each other and be able to add any columns that are new in the merged file.
I have attached some sample data for clarity.
Solved! Go to Solution.
- Labels:
- Batch Macro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@AshaCharis I was testing out a macro built by @apathetichell on your Excel sheets and I think it produces what you want as attached.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@atcodedog05 - Done ! - thanks for the support @RishiK.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you so much for your help.
The files that are coming in are in .csv; do I just need to create another empty file sample the batch off of?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
oh - did you want a combo macro which reads in any of .xlsx,.xls or .csv? It's possible but I haven't done it yet
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
In the macro I wanted it to do is to stack the same columns on top of each other and be able to add any columns that are new in the merged file, but the macro that you first provided seems to not like the fact that I am stacking csvs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Try this one...
@RishiK- updated version which spits out filename and allows for .csvs to be read in...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks for that @apathetichell
