Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default function on a range

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




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default function on a range

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)

"pippo&menelao" wrote in message
...
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 Range
Set A = Range("A1:A10")
Range("B1").FormulaR1C1 = "=AVERAGE(A)"

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

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

How can I do ?

Thanks a lot
sincerely








  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default function on a range

Hi bob
you probably meant:
Range("B1").Formula = "=AVERAGE(A1:A10)"

--
Regards
Frank Kabel
Frankfurt, Germany

"Bob Phillips" schrieb im
Newsbeitrag ...
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)

"pippo&menelao" wrote in

message
...
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 Range
Set A = Range("A1:A10")
Range("B1").FormulaR1C1 = "=AVERAGE(A)"

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

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

How can I do ?

Thanks a lot
sincerely









  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default function on a range

Mixing my worksheets and VBA.

Thanks Frank.

Bob

"Frank Kabel" wrote in message
...
Hi bob
you probably meant:
Range("B1").Formula = "=AVERAGE(A1:A10)"

--
Regards
Frank Kabel
Frankfurt, Germany

"Bob Phillips" schrieb im
Newsbeitrag ...
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)

"pippo&menelao" wrote in

message
...
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 Range
Set A = Range("A1:A10")
Range("B1").FormulaR1C1 = "=AVERAGE(A)"

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

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

How can I do ?

Thanks a lot
sincerely











  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default function on a range

Hi Bob
know this :-) still not enough coffee this day <vbg

--
Regards
Frank Kabel
Frankfurt, Germany

"Bob Phillips" schrieb im
Newsbeitrag ...
Mixing my worksheets and VBA.

Thanks Frank.

Bob

"Frank Kabel" wrote in message
...
Hi bob
you probably meant:
Range("B1").Formula = "=AVERAGE(A1:A10)"

--
Regards
Frank Kabel
Frankfurt, Germany

"Bob Phillips" schrieb im
Newsbeitrag ...
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)

"pippo&menelao" wrote in

message
...
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 Range
Set A = Range("A1:A10")
Range("B1").FormulaR1C1 = "=AVERAGE(A)"

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

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

How can I do ?

Thanks a lot
sincerely












Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Function Range Rich Excel Worksheet Functions 6 September 2nd 07 05:58 PM
DBSUM function but with function as criterion, not a range corne_mo Excel Worksheet Functions 3 July 13th 07 12:20 PM
range function Felicia Excel Discussion (Misc queries) 2 January 29th 07 06:10 PM
How do I set up a range within a IF function? RevoProphet Excel Worksheet Functions 1 December 8th 05 04:00 PM
Range function Manos Excel Worksheet Functions 1 October 3rd 05 10:54 AM


All times are GMT +1. The time now is 03:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"