Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel to text file
I want to export data from several cells into the text file and I am
epxeriencing problem with formatting, I can not have line breaks to give me new line for each entry. I have tried to use Chr(10) and Chr(13) but it does not work. What is wrong in code below: ===================================== Sub PrintAttachments() Dim AttachmentsList As String CheckSecurity AttachmentsList = "" Application.ScreenUpdating = False For i = 1 To 10 For j = 3 To 12 If Worksheets(i).Cells(j, 17) < "" Then AttachmentsList = AttachmentsList + Worksheets(i).Cells(j, 17) & Chr(10) End If Next j Next i If AttachmentsList < "" Then AttachmentsList = "List of attachments: " & Chr(10) & Chr(10) & AttachmentsList Open "c:\temp\attachments.txt" For Output As #1 Write #1, AttachmentsList Close #1 End If Application.ScreenUpdating = True End Sub ===================================== Is there any way of printing my results instead of saving them into txt file ? Thanks for help. Tony |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can I import text file of cash flow to excel file then use formula | Excel Discussion (Misc queries) | |||
Saving multi-tab excel file created from comma delimited text file | Excel Programming | |||
Excel VBA - open text file, replace text, save file? | Excel Programming | |||
Import text file into excel with preset file layout, delimeters VBA | Excel Programming | |||
Open delimited text file to excel without changing data in that file | Excel Programming |