View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Domagoj Vulin Domagoj Vulin is offline
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.