Forum Discussion

wcndave's avatar
wcndave
Copper Contributor
Dec 06, 2018

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

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.

No RepliesBe the first to reply

Resources