Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default saving excel table as text file


Hi there

I really hope someone can help me with this please. I have, in excel,
x columns and y rows containing numerical data. What I need to do is
first create and then save the table into a text file, but retain the
original layout of the data.

Any ideas would be greatly appreciated

Thanks


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default saving excel table as text file

I'm not sure what retain the original format means, but if the data is the whole
worksheet, couldn't you just save a copy of that file as .prn or .csv?

If the data is less than the whole worksheet, you could copy it to a new
worksheet and save it from there?

or:

You may want to try Earl Kiosterud's Text Write program:

It's available at Tushar Mehta's site:
http://www.tushar-mehta.com/
Look for Text Write in the left hand frame.

Or maybe write your own:
Chip Pearson has some nice get-started code at:
http://www.cpearson.com/excel/imptext.htm

phillip harrison wrote:

Hi there

I really hope someone can help me with this please. I have, in excel,
x columns and y rows containing numerical data. What I need to do is
first create and then save the table into a text file, but retain the
original layout of the data.

Any ideas would be greatly appreciated

Thanks

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


--

Dave Peterson

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default saving excel table as text file

On Tue, 15 Jul 2003 00:35:38 -0700, phillip harrison
wrote in
microsoft.public.excel.programming:

[snip]
To be clearer in what i need to do... I have imported a 1 column list of
data from a text file into Excel and, using VBA have done various things
with it one of which is arranging the data into a table like format.
The reason I put "x columns and y rows" in my first question was because
the VBA program I am writing will be run with many text file data lists
and so each one will result in a different table size in excel. Anyway,
the task i now need to do is, via VBA, save the table as a .txt file but
the table format must be kept. By this i dont mean the font but simply
that the value in cell B2 must be in the same position in the text file.

Thanks


Have you tried to save to a PRN file? Like so:
someWorkBook.SaveAs Filename:="fubar.PRN", FileFormat:=xlTextPrinter

--
Michael Bednarek, IT Manager, Tactical Global Management
Waterfront Pl, Brisbane 4000, Australia. "POST NO BILLS"
http://mcmbednarek.tripod.com/
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default saving excel table as text file

Position in a text file means different things depending on how your text file
is formatted.

Try saving it in .prn or .csv to see if that comes close to what you want.
Maybe you don't need a macro at all.


phillip harrison wrote:

Dave, Thanks for the reply and I have checked out Tushar Mehta's site
but unfotunately you need to download the code in a zip file and as Im
at work our internet settings prevent any downloads.

To be clearer in what i need to do... I have imported a 1 column list of
data from a text file into Excel and, using VBA have done various things
with it one of which is arranging the data into a table like format.
The reason I put "x columns and y rows" in my first question was because
the VBA program I am writing will be run with many text file data lists
and so each one will result in a different table size in excel. Anyway,
the task i now need to do is, via VBA, save the table as a .txt file but
the table format must be kept. By this i dont mean the font but simply
that the value in cell B2 must be in the same position in the text file.

Thanks

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


--

Dave Peterson

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
Seeing Text File Names when Saving Excel Files jkiser New Users to Excel 4 January 1st 09 01:57 PM
Saving Excel to Text file BIGGByran Excel Discussion (Misc queries) 1 December 10th 08 09:37 AM
Why Saving a file to a CSV, Excel does not put text into Quotes? Paul Bytes Excel Discussion (Misc queries) 1 January 26th 07 03:59 PM
saving a text file to excel bullseye Excel Worksheet Functions 3 May 4th 06 01:07 AM
saving an excel file as text without text in quotes John Excel Discussion (Misc queries) 2 December 6th 05 06:20 PM


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

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

About Us

"It's about Microsoft Excel"