function on a range

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all
here's my problem
I want to apply a function (ex: average) on a range of data
So I wrote

Dim A as Rang
Set A = Range("A1:A10"
Range("B1").FormulaR1C1 = "=AVERAGE(A)

but it's wrong (#NAME? as error)
I tried with "FormulaLocal" and "Formula", bu
is always wrong

I want to use a range because the range will change every day

How can I do

Thanks a lo
sincerel
 
You need

Range("B1").Formula = "=AVERAGE("A1:A10")"

that is a string, not a range object

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Hi bob
you probably meant:
Range("B1").Formula = "=AVERAGE(A1:A10)"
 

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

Back
Top