Excel Implode Function

Recently we had a project that required some CSVs that were a little tricky to import. One specifically dealing with a bunch of pictures that was formatted with one picture per row. 

In example,

ID Picture
a a-1.jpg
a a-2.jpg
a a-3.jpg
b b-1.jpg
b b-2.jpg
c c-1.jpg
c c-2.jpg
c c-3.jpg

Now, to import with Feeds, we needed the data to be formatted like this:

ID Picture
a a-1.jpg | a-2.jpg | a-3.jpg
b b-1.jpg | b-2.jpg
c c-1.jpg | c-2.jpg | c-3.jpg

Doing this by hand wouldn't be that hard if there were only like 10, or even 50. But there were over 2000 pictures with between 400 and 500 matching IDs. So doing this by hand was really more of a last-resort.

This is where Excel Macros come into play. I had a project a while ago that required me to write a larger-scale macro, so I had at least some experience with Visual Basic and how to do it. 

It only took me a few hours (including debugging and re-writing my algorithm a couple times), but I finally got it! All duplicate IDs had been removed and the pictures imploded into their respective cells.

I posted this function on my Github so that other people could use it. It's not super-flexible at the time, but maybe one day I will get around to changing it so that other people can use it more easily.