Turning an Array into a Comma Delimited String:   Return to List

Function CommaDelimited(inarr As Variant, Optional delim As String = ",") As String
    Dim outp As String
    Dim thruarr As Integer
    For thruarr = LBound(inarr) To UBound(inarr)
        outp = outp & CStr(inarr(thruarr)) & IIf(thruarr < UBound(inarr), delim, "")
    Next thruarr
    CommaDelimited = outp
End Function

See also:
Building an Array of Filenames (after browse)
Delimited Text to an Array (similar to Split())
Determining Upper & Lower Array Bounds
Erasing an Array (removing all the elements)
Feed an Array into a New Document (del dupes)
Filename Array from Active Directory
QuickSort routine
QuickSort Single Dimension
QuickSort (Fast!!) (Multidimensional on 2 dims)
QuickSort (Fast!!) (Multidimensional on 3 dims)
Removing Duplicates from an Array
SQL Query Results placed in an Array
Using Split() function to create Array



Note to Webmaster