Public Function COMBINE(a As Variant, Optional sep As String = "") As String
' Harlan Grove, Mar 2002
Dim y As Variant
If TypeOf a Is Range Then
For Each y In a.Cells
COMBINE = COMBINE & y.Value & sep
Next y
ElseIf IsArray(a) Then
For Each y In a
COMBINE = COMBINE & y & sep
Next y
Else
COMBINE = COMBINE & a & sep
End If
COMBINE = Left(COMBINE, Len(COMBINE) - Len(sep))
End Function
i tried but the macro is not working.