Naming a range

H

Heather

Is there a way for me to name this so that I can use it later to total with
another section

target.Offset(, 6).FormulaR1C1 = "=SUM(R[-1]C:R10C)"

Thank you, Thank you
 
P

Per Jessen

Hi

Look at this:

target.Offset(, 6).FormulaR1C1 = "=SUM(R[-1]C:R10C)"
ActiveWorkbook.Names.Add Name:="SumCell", RefersTo:="=Sheet1!" &
target.Offset(, 6).Address

Debug.Print Range("SumCell").Value

Regards,
Per
 
D

Dave Peterson

You mean name the range that gets the formula:

target.Offset(, 6).FormulaR1C1 = "=SUM(R[-1]C:R10C)"
target.Offset(, 6).Name = "myTotalCell"

Then you could use:

=(mytotalcell + a3) * 12
(or some other expression)
Is there a way for me to name this so that I can use it later to total with
another section

target.Offset(, 6).FormulaR1C1 = "=SUM(R[-1]C:R10C)"

Thank you, Thank you
 
Top