How can I export the text of one column of a workbook as text file and perform the saving with a macro

Jberlin2016

New Member
Joined
Jul 6, 2016
Messages
2
I have a sheet with several workbooks.
The aim of the sheet is to generate a text of a letter automatically depending on a lot of parameters.

In one of the workbooks I have the result in column A. lets call this workbook corrections

The content of the cells in letter_text might be in English, German or French, meaning that it includes characteres like ü, è, ö, é etc.

I created some VB code and assigned it to several buttons in order to export the content of the column A of corrections workbook as a plain text file (extension .txt)

There are only three possibilities in Excel, MSdostext, unicode text, and with tab and even csv.

I need to be able to export the plain text including the special characters of these specific two languages and avoiding any change in the text taht I see in Excel.

So far I wrote the following to export it in three formats. All the three kid of files (msdos text, unicode, and tab separation) are so to say "contaminated" somehow, sometimes including extra " (quotations marks) other not getting the mentioned ü, è, ö, é right.

Any help please

Sub corrections_ALL()
'
' corrections_ALL Macro
'
' msdos Macro
'
Sheets("corrections").Select
Cells.Select
ActiveWorkbook.SaveAs Filename:= _
"C:\Users\JF30443\Desktop\WORK\EXCEL\corrections_msdos\corrections.txt", FileFormat:=xlTextMSDOS

' unicodetext
'
Sheets("corrections").Select
Cells.Select
ActiveWorkbook.SaveAs Filename:= _
"C:\Users\JF30443\Desktop\WORK\EXCEL\corrections_unicodetext\corrections.txt", FileFormat:=xlUnicodeText


' withtab
'
Sheets("corrections").Select
Cells.Select
ActiveWorkbook.SaveAs Filename:= _
"C:\Users\JF30443\Desktop\WORK\EXCEL\corrections_withtab\corrections.txt", FileFormat:=xlText



End Sub
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top