sum up column value in a table

V

VBALover

Hi All,

If there is a table.

1st row contain three column. with data 0,0,3 (each value in each cell)
2nd row contain four column where the 2nd and 3rd column are 50% width of
1st row 2nd column. And the data is 0,0,30,40 (each value in each cell)
3rd .. nth row, each width same as 1st row without data

The problem which I face is, if I need to to put total in 5th row,

{=sum(C1:C4) \#,###,###.00 \* MERGEFORMAT}

the MSword will give out: 33 (3+30)

instead of 43 (3+40) which I expected to have.

Is there any way to sum up with Macro with a (some) smarter way?


Thanks for advice ~
 
D

Doug Robbins

I would suggest that 33 is the result to be expected from adding the values
entered into the 3rd cell in each row (which is what column C is.

To get 43 you would need to use {= C1 + D2 }

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
I

Ian B

An alternate method is to select the column and use ToolsCalculate (a Word
Command).
This puts the result in the clipboard from where you can paste result.
One other advantage with tools calculate, it copes with blank cells, which
sum(??) will not.
~~~~
Selection.SelectColumn
Application.Run MacroName:="ToolsCalculate"
~~~~

HTH

Ian B
 
V

VBALover

Which version of word you are using with command ToolsCalculate?
I am using Word97 which do not have such command.

Thanks for advice
 
I

Ian B

Word 97 has it.
To find command, go to - Tools - macro - macros. Select in the dropdown
"Macros in" Word commands - scroll down to ToolsCalculate and run it.
This is obviously a manual "calculate".
To automate it use the VBA command
Application.Run MacroName:="ToolsCalculate"

Regardless of VBA its a very handy item to drag onto tool bar for every day
use in doing calculations.
Follows normal conventions ie (1000/12 + (3-2)) Highlight the calculation,
press tools calculate and there is the answer (84.33) on the clipboard and
displayed on the bar at bottom of screen. (fogotten its offical name)

HTH

Ian B
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top