Question Excel Number formatting

fachagooch

New member
Joined
Jan 2, 2013
Messages
1
Programming Experience
1-3
I am having a problem when place a number format on the cells it is placing the Decimal point when there is nothing past the whole number example 23 looks like 23. when it is formatted to the sheet, any ideas as to how i can fix this?

Thanks

[XCODE]
xlWorkSheet.Columns("H:H").NumberFormat = "0.##"
[/XCODE]
 
Shouldn't that NumberFormat be "0.0#" ??? Surely if you're working with decimals, you'd want to display 23 as 23.0?
 
Hello,

Don't know if this will helps at all but the following should both work.

.NumberFormat = "0" 'This displays the number as a whole

or

.NumberFormat = "General" 'This is the Excel default which if 23 is entered will show 23 not "23."

Personally I would not format the whole column and only target the cells you are using. The odds on you needing all 1048576 cells in the column formated is pretty slim and will just make the excel file size larger than it needs to be.

Hope that helps
 
Back
Top