sajjaddaya
New Member
- Joined
- Oct 26, 2011
- Messages
- 14
Hi Guys,
I have a macro below that outputs a text file that is pipe delimited, and has quotation marks around the output - this part is perfect!
The problem I am having is that the output in each cell is truncated after a certain point. I have some cells that have GIGANTIC amounts of data in them - how do I modify this macro to output everything in the cell without any truncating?
You're help will be VERY appreciated!
Thanks
Sajjad
I have a macro below that outputs a text file that is pipe delimited, and has quotation marks around the output - this part is perfect!
The problem I am having is that the output in each cell is truncated after a certain point. I have some cells that have GIGANTIC amounts of data in them - how do I modify this macro to output everything in the cell without any truncating?
You're help will be VERY appreciated!
Code:
Public Sub OutputQuotedCSV()
Const QSTR As String = """"
Const DELIMITER As String = "|"
Dim myRecord As Range
Dim myField As Range
Dim nFileNum As Long
Dim sOut As String
nFileNum = FreeFile
Open "File1.txt" For Output As #nFileNum
For Each myRecord In Range("A1:A" & _
Range("A" & Rows.Count).End(xlUp).Row)
With myRecord
For Each myField In Range(.Cells(1), _
Cells(.Row, 256).End(xlToLeft))
sOut = sOut & DELIMITER & QSTR & _
Replace(myField.Text, QSTR, QSTR & QSTR) & QSTR
Next myField
Print #nFileNum, Mid(sOut, 2)
sOut = Empty
End With
Next myRecord
Close #nFileNum
End Sub
Thanks
Sajjad