Created
March 28, 2013 23:11
-
-
Save abeyer/5267582 to your computer and use it in GitHub Desktop.
excel concatenation (yuck!) from http://blog.contextures.com/archives/2010/07/30/combine-cells-in-excel-without-concatenate/
This file contains hidden or 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 ConCat(Delimiter As Variant, ParamArray CellRanges() As Variant) As String | |
| Dim Cell As Range, Area As Variant | |
| If IsMissing(Delimiter) Then Delimiter = "" | |
| For Each Area In CellRanges | |
| If TypeName(Area) = "Range" Then | |
| For Each Cell In Area | |
| If Len(Cell.Value) Then ConCat = ConCat & Delimiter & Cell.Value | |
| Next | |
| Else | |
| ConCat = ConCat & Delimiter & Area | |
| End If | |
| Next | |
| ConCat = Mid(ConCat, Len(Delimiter) + 1) | |
| End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment