Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
Martin ©¿©¬ @nohere.net Martin ©¿©¬ @nohere.net is offline
external usenet poster
 
Posts: 9
Default 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   Report Post  
Posted to microsoft.public.word.tables
Martin ©¿©¬ @nohere.net Martin ©¿©¬ @nohere.net is offline
external usenet poster
 
Posts: 9
Default 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   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default 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   Report Post  
Posted to microsoft.public.word.tables
Martin ©¿©¬ @nohere.net Martin ©¿©¬ @nohere.net is offline
external usenet poster
 
Posts: 9
Default 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   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default 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   Report Post  
Posted to microsoft.public.word.tables
Martin ©¿©¬ @nohere.net Martin ©¿©¬ @nohere.net is offline
external usenet poster
 
Posts: 9
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Figures... Shpresa Microsoft Word Help 2 December 20th 07 06:55 PM
handle many figures mike Page Layout 1 January 27th 06 10:28 PM
table of figures doesn't show all my figures christina Microsoft Word Help 1 December 2nd 05 09:24 AM
TOC and Figures .. PLEASE HELP Mike Microsoft Word Help 1 October 28th 05 05:25 PM
table of figures again Frank Drost Microsoft Word Help 0 July 17th 05 11:03 PM


All times are GMT +1. The time now is 09:48 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"