Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing a number from a cell into a text file 1

Status
Not open for further replies.

feajob

Aerospace
Aug 19, 2003
158
CA
Hi,

I am trying to prepare a text file from a portion of my spreadsheet. But, I have some issues with format of numbers.

For example, I have a number like 3.0 in a cell of my spreadsheet, when my VB subroutine writes this number, I will get 3 instead of 3.0. But, I really need to have 3.0 in the text file, because it is an input file for another program. I guess that there should be a command in VB to control the format of numbers during writing the external file. I appreciate to have your help.

A.A.Y.
 
Replies continue below

Recommended for you

Or you could do something like: Format(<cell value>,"#.##")

The MSDN site has the exact syntax but as long as the value returned by the cell is a number this should work. I think ;) It's been a while since I've done something like this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top