LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default macro to export a range to a text file?

Scratch the part about xlTextWindows, it does save using the quotes. Sorry.

"Buster" wrote:

I was unable to find a solution that would directly export a range, but I
have a workaround you might try. Code the macro to insert a new worksheet
and copy/paste-values the range to export to the new worksheet's A1. Export
the new worksheet using FileFormat property xlTextWindows then delete the
inserted worksheet. [I used xlTextWindows as does not the add quote marks
like xlTextMSDOS.]

It may not be graceful, but it does what you want.

" wrote:

Greetings experts...

Is it possible to export the contents of a specified range to a text
file?

The worksheet will be protected and the cells locked. The range to
export will always be the same. The user will not select the range,
the range should already be defined in the macro.

The macro should not save the entire workbook or worksheet as a text
file, nor should it export the entire workbook or worksheet to a text
file, nor should it prompt the user for any input whatsoever.

Simply the contents of range $A:$5: $B:$20 ---- text file. I searched
and searched for a known solution, but could not find one, hence my
post here.

If a delimiter is required, a simple space or tab will suffice.

Thanks kindly.

(Please note: I reviewed the excellent work of Pearson, Patterson,
Peo, Max, and others, but their examples are not quite what I need, and
I'm unsure of how to modify their examples to fit my needs.)

J




 
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
Export range to text file Matthew Scheperle Excel Discussion (Misc queries) 1 March 21st 10 03:30 AM
Export excel file to semicolon delimited text file capitan Excel Discussion (Misc queries) 5 April 7th 05 03:06 AM
How do I import text file, analyze data, export results, open next file Geoffro Excel Programming 2 March 6th 05 08:02 PM
Export range to text file martin Excel Programming 2 August 30th 04 06:39 PM
Macro to Create text file from range of cells? Joan Roco[_2_] Excel Programming 1 July 28th 04 07:28 PM


All times are GMT +1. The time now is 10:22 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"