Created
May 20, 2015 10:15
-
-
Save NixonInnes/f4d58c0d9bf6f9ead793 to your computer and use it in GitHub Desktop.
[Excel] Concatenate cells with a delimiting character between cells
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function CAT(cell_range As range, delim As String) As String | |
Dim CAT_iter As String | |
Dim iter As Integer | |
iter = 1 | |
For Each cell In cell_range | |
If iter = cell_range.Count Then | |
CAT_iter = CAT_iter & cell.Value | |
Else | |
CAT_iter = CAT_iter & cell.Value & delim | |
End If | |
iter = iter + 1 | |
Next cell | |
CAT = CAT_iter | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment