LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Properly Saving a .CSV File With an 11 Digit Numeric Field

here is a snippet of my code, from research i did on this problem. basically, if excel sees/displays it in a certain way (as in it drops seconds in the date time, for instance), thats how it converts it. thus, you have to custom-set the format of the cell/column

'Have to update dateformat in column H because conversion to csv will drop seconds
'if excel doesnt see complete format

'find last row to apply number format to
Dim iLastRow
iLastRow = Mid(Range("H65536").End(xlUp).Address(0, 0), 2)

Range("H6").Select
Range(Selection, Selection.End(xlDown)).Select
Range("H6:H" & iLastRow).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.NumberFormat = "m/d/yyyy hh:mm:ss"



-hth

On Monday, September 13, 2010 2:22 PM Sheldon Potolsky wrote:


My VBA code saves a spreadsheet as a .csv (... FileFormat:=xlCSV).
The problem? The one numeric field, an eleven digit number, converts
to exponential form, which I do not want.
Any way to do what I am trying to accomplish?

Thanks, Sheldon



On Monday, September 13, 2010 3:41 PM Mike S wrote:


On 9/13/2010 11:22 AM, Sheldon Potolsky wrote:

I do not know if this will help or not, using Excel 2000 when I format
the cells in a column containing numbers with 11 decimal points as text
and save the sheet as csv, the numbers are saved with all of the decimal
points, I can see that by opening the csv file with a text editor. But
when I open the csv file in Excel, only 9 of the decimal places are
displayed. I could not find a setting to restore displaying all 11 of
them anywhere, although one probably exists.

http://www.eggheadcafe.com/software/...-csv-file.aspx




 
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
Excel file not saving properly Noma Jane Dill Excel Discussion (Misc queries) 3 August 29th 06 11:44 PM
Excel file not saving properly Noma Jane Dill Excel Discussion (Misc queries) 2 August 26th 06 06:26 AM
How do I shorten a 17 digit field to a 6 digit field? Paul Bass Excel Programming 2 July 27th 06 04:37 PM
how to tell excel to read numeric field as character fr a csv file Ang Kah Huat Excel Discussion (Misc queries) 3 January 11th 06 11:08 AM
Excel changes file name to numeric name when saving --HELP Greg Rinaldi Excel Discussion (Misc queries) 1 February 6th 05 11:01 PM


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