E
Excel Helps
Could I modify the UDF seen below to do this?
a¦a|b¦b|c¦c|d¦d
where abcd are data in cells in one sheet
and the piped data is placed into another sheet with duplications of the
origial sheet, separated by broken pipes
and solid pipes.
Function ConCatRange(CellBlock As Range) As String
Dim Cell As Range
Dim sbuf As String
Dim pipe As Boolean
pipe = True
For Each Cell In CellBlock
pipe = Not pipe
If Len(Cell.Text) > 0 Then
If pipe = False Then
sbuf = sbuf & Cell.Text & Chr(166)
Else
sbuf = sbuf & Cell.Text & "|"
End If
End If
Next
ConCatRange = sbuf
End Function
a¦a|b¦b|c¦c|d¦d
where abcd are data in cells in one sheet
and the piped data is placed into another sheet with duplications of the
origial sheet, separated by broken pipes
and solid pipes.
Function ConCatRange(CellBlock As Range) As String
Dim Cell As Range
Dim sbuf As String
Dim pipe As Boolean
pipe = True
For Each Cell In CellBlock
pipe = Not pipe
If Len(Cell.Text) > 0 Then
If pipe = False Then
sbuf = sbuf & Cell.Text & Chr(166)
Else
sbuf = sbuf & Cell.Text & "|"
End If
End If
Next
ConCatRange = sbuf
End Function