Concatenate Range With Separator

  • I've been trying to modify a UDF that I built a while back with the help of this board. The function concatenates cells within a range and places a separator between each of the values. The modification prevents the separator from being inserted between cells without a value. The function is almost perfect with this code:


    The only issue is that it usually inserts a separator at the front of the string. I added a test for using the separator the first time (additional code is bold). The code doesn't work. Instead of removing the first occurence of the separator, it removes all occurences.


    Could someone point out the error of my ways? Thanks.


    Steve

  • Re: Concatenate Range With Separator


    Try this

  • Re: Concatenate Range With Separator


    This solution works for my particular dataset; however, I'm getting an additional field separator added to the beginning of the range that I don't need. The concatenated result should look like '55.10.25'. yet the actual results are '.55.10.25'.


    Being a complete VBA novice; OK - I know nothing about VBA, I'm not sure how to debug this script and modify so that it does not insert a separator at the beginning of the concatenated string.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!