If I understand what you want correctly, assigning this to the Formula
property of the cell you want to contain the summation should do it...
"=SUM(MyRange)"
where MyRange is the name of the range that you assigned from the NameBox or
via the Insert/Name/Define dialog box. If you have the named range assigned
to a variable (named, say, NamedRange) in your code, then you would use this
instead...
"=SUM(" & NamedRange & ")"
--
Rick (MVP - Excel)
"Mikey" wrote in message
...
I need the formula. I can get the value by naming the selected range and
then using the Sum("namedrange") function. I have to copy/paste values to
be
able to reuse the named range on addition lines in the worksheet. With
the
formula, I can copy it to cells adjacent to it cells (monthly totals and a
yearly total) and then move down the worksheet to Sum additional products
or
items. Thanks for the interest as this is really important to me to be
able
to use for multiple application.
--
Mickey
"Rick Rothstein" wrote:
Your question is not entirely clear to me. You say "formula" and that you
will "copy and repeat the code" throughout the "worksheet"... are you
looking for a formula or VB code in the end? If VB code, do you want it
to
insert a summation formula or do you want it to perform the summation and
just enter that value in the total cell? Is this summation formula or
value
being placed in the cell immediately after the last value in a column?
What
columns are we talking about?
--
Rick (MVP - Excel)
"Mikey" wrote in message
...
I'm trying to Sum various numbers of rows in a large worksheet. I need
a
genric formula to sum the continuous rows of numbers above the total
line
where the formula will be located. The number of continuous rows for
each
instance will be different, therefore the need for the general
reference
or
generic formula. I've tried the Range(Selection,
Selection.Offset(-1,0)
and
ActiveCell.Offset (-1,0) and also the Selection(xlEndUp) codes but
can't
get
them to produce the Sum function correctly. I can copy and repeat the
code
throughout the worksheet if only I can figure out how to do the first
one.
Help please. I've tried to doulbe click the Sum button but it gives me
the
specific range at the time and is not usable on other rows farther
down
in
the worksheet.
--
Mickey