Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default SaveAs *.txt - Outputting with Text quantifiers

Hello,

I am trying to export a worksheet as a *.txt file but do not want the text
quantifiers to appear (ie. the quotations around the text columns).

Here is a snippet of my saveas code:
ActiveWorkbook.SaveAs Filename:=mylocation , _
FileFormat:=xlText, CreateBackup:=False

Do I either have to change the format of the columns before I use the SaveAs
or can I mod the SaveAs function (ie. use a different paramter or try
different FileFormat's.)

Thanks,
-Steve
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default SaveAs *.txt - Outputting with Text quantifiers

Maybe you could save the file as a .PRN file.

Or maybe you could use a macro and do exactly what you want:

On the other hand, if the data contains those double quotes, I'd use a macro:

(saved from a previous post)

Here are three sites that you could steal some code from:

Earl Kiosterud's Text Write program:
www.smokeylake.com/excel
(or directly: http://www.smokeylake.com/excel/text_write_program.htm)

Chip Pearson's:
http://www.cpearson.com/excel/imptext.htm

J.E. McGimpsey's:
http://www.mcgimpsey.com/excel/textfiles.html

(or maybe you could build your own formula and copy|paste into Notepad.)

Check out Earl's Text Write program first. It may do exactly what you want
right out of the box.

=========
Another way is to use a helper column and concatenate each of the fields the way
you want:

=a1&"|"&b1&"|"&text(c1,"dd-mm-yyyy")&"|"&text(d1,"0000000.000")
(where | isn't used in your data)

then drag down.

Then copy that column and paste into NotePad and save from there.

stevieb wrote:

Hello,

I am trying to export a worksheet as a *.txt file but do not want the text
quantifiers to appear (ie. the quotations around the text columns).

Here is a snippet of my saveas code:
ActiveWorkbook.SaveAs Filename:=mylocation , _
FileFormat:=xlText, CreateBackup:=False

Do I either have to change the format of the columns before I use the SaveAs
or can I mod the SaveAs function (ie. use a different paramter or try
different FileFormat's.)

Thanks,
-Steve


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default SaveAs *.txt - Outputting with Text quantifiers

Very simple -
Change to: FileFormat:=xlTextPrinter
Regards
Charlie.B

Hello,

I am trying to export a worksheet as a *.txt file but do not want the text
quantifiers to appear (ie. the quotations around the text columns).

Here is a snippet of my saveas code:
ActiveWorkbook.SaveAs Filename:=mylocation , _
FileFormat:=xlText, CreateBackup:=False

Do I either have to change the format of the columns before I use the SaveAs
or can I mod the SaveAs function (ie. use a different paramter or try
different FileFormat's.)

Thanks,
-Steve

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default SaveAs *.txt - Outputting with Text quantifiers

This does not output into one line.

"CB" wrote:

Very simple -
Change to: FileFormat:=xlTextPrinter
Regards
Charlie.B

Hello,

I am trying to export a worksheet as a *.txt file but do not want the text
quantifiers to appear (ie. the quotations around the text columns).

Here is a snippet of my saveas code:
ActiveWorkbook.SaveAs Filename:=mylocation , _
FileFormat:=xlText, CreateBackup:=False

Do I either have to change the format of the columns before I use the SaveAs
or can I mod the SaveAs function (ie. use a different paramter or try
different FileFormat's.)

Thanks,
-Steve

.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default SaveAs *.txt - Outputting with Text quantifiers

If you want the data all in one line then you need to alter the file
before saving out to a *.txt file - The output depends on what the data
source.
The xlTextPrinter will just stop the quotations around text.
Charlie.B

stevieb wrote:

This does not output into one line.

"CB" wrote:


Very simple -
Change to: FileFormat:=xlTextPrinter
Regards
Charlie.B


Hello,

I am trying to export a worksheet as a *.txt file but do not want the text
quantifiers to appear (ie. the quotations around the text columns).

Here is a snippet of my saveas code:
ActiveWorkbook.SaveAs Filename:=mylocation , _
FileFormat:=xlText, CreateBackup:=False

Do I either have to change the format of the columns before I use the SaveAs
or can I mod the SaveAs function (ie. use a different paramter or try
different FileFormat's.)

Thanks,
-Steve


.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Outputting rows with a given value to new worksheet erik_gregory Excel Discussion (Misc queries) 1 January 21st 09 06:24 AM
SaveAs call changes text to ##### dawn Excel Programming 4 December 3rd 08 05:29 PM
SaveAs Text Dan Excel Programming 1 October 11th 07 03:02 PM
Outputting a formula in a cell using VB Cardiff Maths Student Excel Programming 1 April 6th 05 12:23 PM
importing text file, removing data and outputting new text file Pal Excel Programming 8 February 27th 04 08:32 PM


All times are GMT +1. The time now is 07:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"