
SUM from a table in a variable
Hi PT,
Use the following then:
Dim mysum, i, myrange As Range
mysum = 0
For i = 1 To 10
Set myrange = ActiveDocument.Tables(1).Cell(i, 1).Range
myrange.End = myrange.End - 1
If IsNumeric(myrange) Then mysum = mysum + myrange
Next i
MsgBox mysum
--
Please respond to the newsgroups for the benefit of others who may be
interested.
Hope this helps
Doug Robbins - Word MVP
Quote:
> Hello,
> Thanks for your help. Yes, that worked to sum the contents.
> But 'Val' gets only the numeric value. That means in those columns i
> have an amount, like 10'000.00. But with 'Val' i get only 10. How
> could I sum it up and to get the sum in a currency value?
> regards, PT