Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function CONCATENATEMULTIPLE(Ref As Range, Optional Separator As String) As String
- Dim Cell As Range
- Dim Result As String
- If IsNull(Separator) Then
- Separator = ""
- End If
- For Each Cell In Ref
- Result = Result & Cell.Value & Separator
- Next Cell
- If Separator = "" Then
- CONCATENATEMULTIPLE = Result
- Else
- CONCATENATEMULTIPLE = Left(Result, Len(Result) - 1)
- End If
- End Function
Advertisement
Add Comment
Please, Sign In to add comment