View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default OFFSET behaving oddly

Hi Ryan,

(Idea: http://www.mcgimpsey.com/excel/udfs/multicat.html, this one
works also on arrays)


Option Explicit


'********************************************
'Purpose: Concatenate all cells in a range or
' array
'Inputs: vP - range/array to be concatenated
' sDelim - optional delimiter to be
' inserted between text parts
'Returns: Concatenated string
'*****************************************
Function MultiCat( _
ByRef vP As Variant, _
Optional ByVal sDelim As String = "") _
As String
Dim vE As Variant
For Each vE In vP
MultiCat = MultiCat & sDelim & vE
Next vE
MultiCat = Mid(MultiCat, Len(sDelim) + 1)
End Function


HTH,
Bernd