[TABLE="width: 500"]
<tbody>[TR]
[TD]Sub MakeTextWithVerticalBarDelimiter()
Dim R As Long, LastRow As Long, LastCol As Long, FF As Long
Dim PathFilename As String, Result As String
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
For R = 1 To LastRow
LastCol = Cells(R, Columns.Count).End(xlToLeft).Column
Result = Result & vbNewLine & Join(Application.Index(Cells(R, 1).Resize(, LastCol).Value, 1, 0), "|")
Next
PathFilename = "[B][color="#FF0000"]c:\temp\test.txt[/COLOR][/B]"
FF = FreeFile
Open PathFilename For Output As [URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FF"]#FF[/URL]
Print [URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FF"]#FF[/URL] , Mid(Result, Len(vbNewLine))
Close [URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FF"]#FF[/URL]
End Sub[/TD]
[/TR]
</tbody>[/TABLE]