Skip to content

Instantly share code, notes, and snippets.

@jami-i
Created June 25, 2015 10:21
Show Gist options
  • Save jami-i/de7c5ee149bd21c257a1 to your computer and use it in GitHub Desktop.
Save jami-i/de7c5ee149bd21c257a1 to your computer and use it in GitHub Desktop.
mkString in Visual Basic
Function mkString(mid As String, arg As Range) As String
Dim c As Range, ans As String
For Each c In arg
ans = ans & c.Text & mid
Next c
mkString = left(ans, Len(ans) - len(mid))
End Function
Function mkString2(l As String, mid As String, r As String, arg As Range) As String
Dim c As Range, ans As String
For Each c In arg
ans = ans & c.Text & mid
Next c
mkString2 = l & left(ans, Len(ans) - len(mid)) & r
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment