Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Formatted output to text file

I know there is a simple answer to this, but I can't seem to find it in the
help file. I am using the VBA print# statement to create a text file with
numbers in right justified columns. One of the columns will contain a
floating point value and I need to contol the output width of this so it
lines up correctly. I don't want to use a fixed decimal point format because
the output number might be anywhere in the range of 100000+ to less than 1,
so I need to control the output to a fixed number of significant figures. I
am sure there's a parameter where you can set the width of an output string,
but I can't find it. Can anyone help?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Formatted output to text file

Simon:

You can use spc(x) or tab(x).

In your situation it is probably easier to print the integer part and then
the decimal.
using format to get the right spacing.
--
Hope this helps
Martin Fishlock
Please do not forget to rate this reply.


"simonc" wrote:

I know there is a simple answer to this, but I can't seem to find it in the
help file. I am using the VBA print# statement to create a text file with
numbers in right justified columns. One of the columns will contain a
floating point value and I need to contol the output width of this so it
lines up correctly. I don't want to use a fixed decimal point format because
the output number might be anywhere in the range of 100000+ to less than 1,
so I need to control the output to a fixed number of significant figures. I
am sure there's a parameter where you can set the width of an output string,
but I can't find it. Can anyone help?

Thanks

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
Using Excel in Formatted Output John[_31_] Excel Worksheet Functions 2 November 8th 09 09:54 PM
Converting formatted text into a txt file Marc Excel Discussion (Misc queries) 1 June 21st 07 04:00 PM
Open CSV file, format data and write output to a text file. BristolBloos Excel Programming 1 October 18th 05 03:50 PM
HELP!! Exporting formatted text file Excel user via OfficeKB.com Excel Programming 0 June 14th 05 03:45 PM
CSV formatted text file to Excel Sobhan Excel Programming 3 February 9th 04 03:31 AM


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