Workaround:
Public Function testfunc(S As String, Optional R As String = vbNullString) As String testfunc = S If R <> vbNullString Then For Each cell In Range(R) ' & for concatenation not + ' testfunc = testfunc & cell Next cell End If End Function Sub test() MsgBox testfunc("", "A1:A5"), vbOKOnly, "Results" MsgBox testfunc(""), vbOKOnly, "Results" End Sub
user180100
source share