Josh
Another approach would be to click on all the cells you want to sum
and assign those discontiguous cells a name (insert names define) like
"sumcells". Then your formula could be simple, =sum(sumcells).
Implementation of this approach could possibly be simplified if the
cells to be summed have a common feature that would allow you to
select them all at once using goto special. For example if you are
summing all the cells that contain formulas in a range and only those,
you would highlight the range, use GoTo (F5) Special then formulas.
The cells would all be selected, you then insert your range name. The
simple formla =sum(sumcells) would work.
Good luck.
Ken
Norfolk, Va
On Apr 25, 4:25*am, Bernd P wrote:
Hello,
You might want to sum from the smallest column and row index up to the
highest (SUM(A2:G7)) if no other "unwanted" numbers appear in that
area.
Or you mark all wanted cells with a special number format (currency
different from other numbers, for example) and you sum by that format
condition, for example with a UDF such as:
Function smf(r As Range)
'Sum my format: sums up all values in r which have
'the same format as calling cell (where this
'function is called from).
Dim v
With Application.Caller
For Each v In r
* * If v.NumberFormat = .NumberFormat Then
* * * * smf = smf + v
* * End If
Next v
End With
End Function
Or you mark them with a special background colour and sum by that
(http://www.ozgrid.com/VBA/sum-count-cells-by-color.htm).
If you cannot separate wanted numbers from unwanted ones
("include" (=specify) your wanted numbers or "exclude" unwanted ones)
this will be difficult :-)
Regards,
Bernd