Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Problem with saving REAL type to txt file

I have one little problem related to my post from yesterday.
I had to save a .txt file with spreadsheet data and that works fine, but the
problem is that my macro doesn't save REAL type with decimal point but it
saves like it is integer.
Example: if one cell has value 50.0, and I load the cell into a Single type
variable, when saved, it appears in txt file like 50 instead of 50. or 50.0
That's sort of problem, because it's input file for a old fortran
application which needs REAL type at that field.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Problem with saving REAL type to txt file


"Domagoj Vulin" wrote in message
...
I have one little problem related to my post from yesterday.
I had to save a .txt file with spreadsheet data and that works fine, but

the
problem is that my macro doesn't save REAL type with decimal point but it
saves like it is integer.
Example: if one cell has value 50.0, and I load the cell into a Single

type
variable, when saved, it appears in txt file like 50 instead of 50. or

50.0
That's sort of problem, because it's input file for a old fortran
application which needs REAL type at that field.


Solved, not quite elegant, so if someone has real solution of a problem...
Function MakeDecimal(MyValue)
If InStr(1, LTrim$(Str(MyValue)), ".") = 0 Then
MakeDecimal= LTrim$(Str(MyValue)) & "."
End If
End Function

The point is that in txt. file all is string.


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
Problem saving a file Kassie Excel Discussion (Misc queries) 3 March 15th 09 06:32 PM
problem saving csv file CoyB Excel Discussion (Misc queries) 2 August 29th 06 04:31 PM
File Size a real problem! Wayne Knazek Excel Discussion (Misc queries) 3 August 24th 06 12:40 AM
I am not real sure what type formula to use frustratedwthis Excel Discussion (Misc queries) 1 May 2nd 05 08:50 PM
problem when saving CSV file mhe Excel Worksheet Functions 1 April 5th 05 07:45 PM


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