Option Explicit
Function My_Text_Join(delimiter As String, ignore_empty As Boolean, text_range As Range) As String
Application.Volatile
Dim c As Range
Dim n As Long
n = 0
For Each c In text_range
If ignore_empty = True Then
If VBA.IsEmpty(c.Value) = False Then
If n = 0 Then
My_Text_Join = c.Value
Else
My_Text_Join = My_Text_Join & delimiter & c.Value
End If
n = n + 1
End If
Else
If n = 0 Then
My_Text_Join = c.Value
Else
My_Text_Join = My_Text_Join & delimiter & c.Value
End If
n = n + 1
End If
Next
End Function