Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
inquirer
 
Posts: n/a
Default save excel file formatted as f12.3

I have an excel file with 14 columns. I want to save this as a text file
with all columns 12 characters wide and those columns which are numeric to 3
decimal places. All other columns if empty should contain 12 spaces. Columns
which contains alphas should be left justified; colmns containing numerics
should be right justified.
Is there an easy way to do this?
Thanks
Chris


  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

I'd use 15 helper columns.

Say your data is in A1:Nxxx

I'd put this formula in O1:
=IF(ISNUMBER(A1),TEXT(A1,"00000000.000"),LEFT(A1&R EPT(" ",12),12))
And drag to cell AB1.

Then in the 15 helper cell AC1, I'd put this formula:

=O1&P1&Q1&R1&S1&T1&U1&V1&W1&X1&Y1&Z1&AA1&AB1

Then I'd drag all 15 helper formulas down the rows I need.

Finally, I'd select column AC and copy, start up NotePad and paste there.

Then finally save to the text file from notepad.

(Keep the formulas (hide the columns) if you have to do this over and over and
over.)

inquirer wrote:

I have an excel file with 14 columns. I want to save this as a text file
with all columns 12 characters wide and those columns which are numeric to 3
decimal places. All other columns if empty should contain 12 spaces. Columns
which contains alphas should be left justified; colmns containing numerics
should be right justified.
Is there an easy way to do this?
Thanks
Chris


--

Dave Peterson
  #3   Report Post  
inquirer
 
Posts: n/a
Default

Thanks Dave, I will try that
Chris
"Dave Peterson" wrote in message
...
I'd use 15 helper columns.

Say your data is in A1:Nxxx

I'd put this formula in O1:
=IF(ISNUMBER(A1),TEXT(A1,"00000000.000"),LEFT(A1&R EPT(" ",12),12))
And drag to cell AB1.

Then in the 15 helper cell AC1, I'd put this formula:

=O1&P1&Q1&R1&S1&T1&U1&V1&W1&X1&Y1&Z1&AA1&AB1

Then I'd drag all 15 helper formulas down the rows I need.

Finally, I'd select column AC and copy, start up NotePad and paste there.

Then finally save to the text file from notepad.

(Keep the formulas (hide the columns) if you have to do this over and over
and
over.)

inquirer wrote:

I have an excel file with 14 columns. I want to save this as a text file
with all columns 12 characters wide and those columns which are numeric
to 3
decimal places. All other columns if empty should contain 12 spaces.
Columns
which contains alphas should be left justified; colmns containing
numerics
should be right justified.
Is there an easy way to do this?
Thanks
Chris


--

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
VBA for Excel 2000 file is corrupt nkamp Excel Discussion (Misc queries) 0 May 26th 05 03:37 PM
Opening an Excel file Sheldon Zaklow Excel Discussion (Misc queries) 0 March 3rd 05 10:29 PM
How save a lotus 2.2 file in excel and to open it in excel and pe. bird New Users to Excel 0 February 26th 05 01:57 AM
Excel file takes a long time to save ben@bikecenturies Excel Discussion (Misc queries) 1 February 3rd 05 12:27 AM
How do I save a file in excel with a preview? Jade Excel Discussion (Misc queries) 1 January 19th 05 08:29 PM


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