Home

Cells with line breaks when saving Excel file as a Unicode text using VBA

wcndave
Occasional Visitor

When doing "save as" and selecting unicode, line breaks in cells are handled, the whole thing is wrapped in "" properly.

 

When using vba

 

Set wb = Application.Workbooks.Add
WorkRng.Copy
wb.Worksheets(1).Paste
saveFile = Application.GetSaveAsFilename(fileFilter:="Text Files (*.txt), *.txt")
wb.SaveAs Filename:=saveFile, FileFormat:=xlUnicodeText, CreateBackup:=False
wb.Close

 

It doesn't, each line break is written on a new line in the text file.

Related Conversations
Extentions Synchronization
ChirmyRam in Discussions on
3 Replies
Tabs and Dark Mode
cjc2112 in Discussions on
35 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies