Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This might be a silly question but why use the crosstab query whey you can
just attach a pivot table directly to your source data (not limited to the 65,536 rows in Excel) in Access and then you get all of the functionality of the pivot table which is a lot better than the cross tab. That way you can avoid the code... -- HTH... Jim Thomlinson "Craig" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
chart keeps putting the values together on same line | Excel Discussion (Misc queries) | |||
hide values and display a decimal point that fills the cell | Excel Worksheet Functions | |||
how do I stop excel putting a space after a decimal point | Excel Discussion (Misc queries) | |||
putting values into cells is slow | Excel Programming | |||
Putting correct values in cells | Excel Programming |