View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Remove #VALUE! from ConCat Range Function

I posted this in the Excel user group

See J.E's function
http://www.mcgimpsey.com/excel/udfs/multicat.html


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Excel Helps" wrote in message ...
How do I remove the #VALUE! from my output file when running the function
below.
Some cells in my input file have no data, and I need the output file to
reflect this rather than displaying a #VALUE! error.

Function ConCatRange(CellBlock As Range) As String
Dim Cell As Range
Dim sbuf As String

For Each Cell In CellBlock
If Len(Cell.Text) 0 Then

sbuf = sbuf & Cell.Text & Chr(166)
sbuf = sbuf & Cell.Text & "|"

End If
Next
ConCatRange = Left(sbuf, Len(sbuf) - 1)

End Function