I have looked around, but can't find anything that solves my problem. I am not great at VBA, but can piece together here and there. I have a spreadsheet where users copy columns of image file paths. These columns can vary greatly from one or two to 50. It all depends on the user. The rows will also vary in amount. It is required that the users paste in a header row, but those names can be different.

What I need to do is to concatenate a URL on the beginning of each file path. This url is provided in a userform. Right now, I have a custom function that concatenates everything perfectly fine. Where I am struggling is how to get the formula in each row of the calculation column. The other issue with this is there can be blank rows. I can't remove them or sort anything as this will be put back into another spreadsheet later, linking up with corresponding data. Also, there can be blank cells within each row. Here is an example.

Image 1 Image 2 Image 3 Image 4 Image 5
c/123.jpg c/124.jpg c/125.jpg
c/131.jpg c/132.jpg c/133.jpg c/134.jpg c/135.jpg




This is the formula I have right now, which is using the StringConcat custom function.

Please Login or Register  to view this content.
Obviously, this is convoluted and can probably be done in a different manner. The StringConcat function will concatenate everything in a range with the delimiter you specify. So =StringConcat("delimiter", range)

I am having issues trying to get a formula to work and then be pulled down to the last row. I have more steps that need to be accomplished, but this is the big one. I don't mind if there is a way to do this with going cell by cell and creating a formula or if someone knows how to do the concatenate without pulling in the blank cells. I haven't put in the code to fill down the formula, but that is because it is static as I am putting variables into cells and using them. I believe this is causing the problem.

Any help is appreciated. I have been working on this and it is just starting to blend all together.