data ranges

G

greg

Hello,
I would like to define a named range
such as D5, D6, D7 as the range.
I define it as test1.
And I want to reference it somewhere else.
Say F8 (=test1)

But I want F8 to be the sum of all of these numbers in the range.
Is there a way to do this.
Besides making a different named cell D8 as the sum of D5-D7?

thanks
 
B

Bob Phillips

Range("D5:D7").Name = "myRange"

Range("F8").value = Application.Sum(Range("myRange"))

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)
 
E

Earl Kiosterud

Greg,

Insert - Name - Define. In the box, enter test1. In "Refers to:" put:

=SUM(Sheet1!$D$5:$D$7) or
=SUM(Sheet1!$D$5,Sheet1!$D$6,Sheet1!$D$7)

In either case, you can click or drag the cells after clicking into the
"Refers to" box instead of typing the cell references.

Click "Add"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top