I am trying to use the following macro to save the contents of Sheet2 to a text file.
The problem is that I have long text in Sheet2 that has more than 1095 characters.
Is there a way to change this macro in order to use it?
If I simply copy the whole Sheet2 with copy and paste it to textpad it is working fine, but if I copy it to a different workbook it seems also that it gets truncated at 1024, but in reality there is more contents after that.
Thanks in advance for any feedback,
Mark
Sub SaveAsText()
Dim lngRow As Long, lngLastRow As Long
Open "c:\temp\" & Range("A1").Value For Output As #1
With Worksheets("Sheet2")
lngLastRow = .Cells(Rows.Count, 1).End(xlUp).Row
For lngRow = 1 To lngLastRow
Print #1, .Cells(lngRow, 1).Text
Next lngRow
End With
Close #1
MsgBox "Database stored under " & "c:\temp\" & Range("A1").Value
End Sub
The problem is that I have long text in Sheet2 that has more than 1095 characters.
Is there a way to change this macro in order to use it?
If I simply copy the whole Sheet2 with copy and paste it to textpad it is working fine, but if I copy it to a different workbook it seems also that it gets truncated at 1024, but in reality there is more contents after that.
Thanks in advance for any feedback,
Mark
Sub SaveAsText()
Dim lngRow As Long, lngLastRow As Long
Open "c:\temp\" & Range("A1").Value For Output As #1
With Worksheets("Sheet2")
lngLastRow = .Cells(Rows.Count, 1).End(xlUp).Row
For lngRow = 1 To lngLastRow
Print #1, .Cells(lngRow, 1).Text
Next lngRow
End With
Close #1
MsgBox "Database stored under " & "c:\temp\" & Range("A1").Value
End Sub