Add the prefix and suffix to the string if the string is not empty
the input string
text to add at the start of the string
text to add at the end of the string
Dim i as Long Dim s as String s = "" For i=1 To 9 : s = AddIfNotMt(s, ", ","") Debug.Print s prints: 1, 2, 3, 4, 5, 6, 7, 8, 9