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

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Forum statistics

Threads
1,214,983
Messages
6,122,582
Members
449,089
Latest member
Motoracer88

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