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: 208
Default Putting decimal values in a cell.

I exported my Crosstab query from Access into Excel since the date ranges
vary and the end column has to be totalled up. I try using the NumberFormat:
See code below. The total cell does just rounds the number even though it
shows 2 decimal places.

'Add up the totals horizontally to get a sum amount.
For i = intDataStartRow To intRows
intValue = 0
For j = intDataStartCol To intCols
Cells(i, j).NumberFormat = "0.00"
intValue = Cells(i, j).Value + intValue
Next j 'Next column
Cells(i, j).NumberFormat = "0.00"
Cells(i, j).Value = intValue 'insert the sum now that we are done
with the column.
Cells(i, j).Font.Bold = True 'bold it
Next i 'Next row

Thanks in advance!!
From Access Guy
 
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
chart keeps putting the values together on same line NocturnalLunacy Excel Discussion (Misc queries) 1 January 6th 09 06:13 PM
hide values and display a decimal point that fills the cell Sally Excel Worksheet Functions 2 October 10th 06 05:01 AM
how do I stop excel putting a space after a decimal point Billious Excel Discussion (Misc queries) 1 February 16th 06 08:18 AM
putting values into cells is slow inquirer Excel Programming 5 May 13th 05 03:49 AM
Putting correct values in cells Nick Excel Programming 1 August 26th 04 04:01 PM


All times are GMT +1. The time now is 09:26 AM.

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"