Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.tables
|
|||
|
|||
Need help to add up figures please
Hi
I have various groups of figures (example below) in column B of a word table. I would like to total each group and put the total in column C opposite the ------------- Could someone help me with a formula for this please that will include blank spaces if there are any and a variable number of figures Thank you -- Martin ©¿©¬ 21,693.00 1,473.00 6,240.00 146.85 ---------- 1,446.00 1,635.00 1,639.66 ---------- 3,360.00 1,470.00 1,313.00 4,725.00 1,365.00 20.00 105.00 735.00 ---------- 7,864.89 532.00 1,204.00 976.00 ---------- 339.00 387.34 293.75 --------- 220.00 100.00 100.00 --------- 3,595.89 808.17 2,000.90 684.86 136.20 ------------ 1,220.20 165.00 488.72 469.00 99.88 258.37 96.22 ---------- |
#2
Posted to microsoft.public.word.tables
|
|||
|
|||
Need help to add up figures please
Sorry, I should have added I'm using Office Word 2003
-- Martin ©¿©¬ On Sat, 19 Apr 2008 14:51:39 GMT, Martin ©¿©¬ @nohere.net wrote: Hi I have various groups of figures (example below) in column B of a word table. I would like to total each group and put the total in column C opposite the ------------- Could someone help me with a formula for this please that will include blank spaces if there are any and a variable number of figures Thank you |
#3
Posted to microsoft.public.word.tables
|
|||
|
|||
Need help to add up figures please
Easiest way is to use a macro
Dim i As Long Dim number As Range Dim total As Double total = 0 With ActiveDocument.Tables(1) For i = 1 To .Rows.Count Set number = .Cell(i, 2).Range number.End = number.End - 1 If IsNumeric(number) Then total = total + number Else .Cell(i, 3).Range.Text = Format(total, "#,###.00") total = 0 End If Next i End With -- 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 Martin ©¿©¬ @nohere.net wrote in message ... Hi I have various groups of figures (example below) in column B of a word table. I would like to total each group and put the total in column C opposite the ------------- Could someone help me with a formula for this please that will include blank spaces if there are any and a variable number of figures Thank you -- Martin ©¿©¬ 21,693.00 1,473.00 6,240.00 146.85 ---------- 1,446.00 1,635.00 1,639.66 ---------- 3,360.00 1,470.00 1,313.00 4,725.00 1,365.00 20.00 105.00 735.00 ---------- 7,864.89 532.00 1,204.00 976.00 ---------- 339.00 387.34 293.75 --------- 220.00 100.00 100.00 --------- 3,595.89 808.17 2,000.90 684.86 136.20 ------------ 1,220.20 165.00 488.72 469.00 99.88 258.37 96.22 ---------- |
#4
Posted to microsoft.public.word.tables
|
|||
|
|||
Need help to add up figures please
Thanks for your time & help Doug I haven't a clue about macros, however I read an article about ToolsCalculate at http://word.mvps.org/FAQs/General/ToolsCalculate.htm which is doing the job for me That's something else I've learnt today -- Regards Martin ©¿©¬ On Sun, 20 Apr 2008 08:29:24 +1000, "Doug Robbins - Word MVP" wrote: Easiest way is to use a macro Dim i As Long Dim number As Range Dim total As Double total = 0 With ActiveDocument.Tables(1) For i = 1 To .Rows.Count Set number = .Cell(i, 2).Range number.End = number.End - 1 If IsNumeric(number) Then total = total + number Else .Cell(i, 3).Range.Text = Format(total, "#,###.00") total = 0 End If Next i End With |
#5
Posted to microsoft.public.word.tables
|
|||
|
|||
Need help to add up figures please
See the article "What do I do with macros sent to me by other newsgroup
readers to help me out?" at: http://www.word.mvps.org/FAQs/Macros...eateAMacro.htm -- 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 Martin ©¿©¬ @nohere.net wrote in message ... Thanks for your time & help Doug I haven't a clue about macros, however I read an article about ToolsCalculate at http://word.mvps.org/FAQs/General/ToolsCalculate.htm which is doing the job for me That's something else I've learnt today -- Regards Martin ©¿©¬ On Sun, 20 Apr 2008 08:29:24 +1000, "Doug Robbins - Word MVP" wrote: Easiest way is to use a macro Dim i As Long Dim number As Range Dim total As Double total = 0 With ActiveDocument.Tables(1) For i = 1 To .Rows.Count Set number = .Cell(i, 2).Range number.End = number.End - 1 If IsNumeric(number) Then total = total + number Else .Cell(i, 3).Range.Text = Format(total, "#,###.00") total = 0 End If Next i End With |
#6
Posted to microsoft.public.word.tables
|
|||
|
|||
Need help to add up figures please
On Mon, 21 Apr 2008 05:33:51 +1000, "Doug Robbins - Word MVP"
wrote: See the article "What do I do with macros sent to me by other newsgroup readers to help me out?" at: http://www.word.mvps.org/FAQs/Macros...eateAMacro.htm Thanks Doug, I got your macro up and running However, it puts 0 or 00 in blank lines and it doesn't work on a second page of the same document, but it does work if I copy the data on the 2nd page to a new sheet ? -- Martin ©¿©¬ |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Figures... | Microsoft Word Help | |||
handle many figures | Page Layout | |||
table of figures doesn't show all my figures | Microsoft Word Help | |||
TOC and Figures .. PLEASE HELP | Microsoft Word Help | |||
table of figures again | Microsoft Word Help |