PC Review


Reply
Thread Tools Rate Thread

array formula in macro

 
 
=?Utf-8?B?ZXppbA==?=
Guest
Posts: n/a
 
      11th Aug 2007
The following array formula is working when directly written in cell. But I
have to do
this through a macro. How to write the following command line correctly in a
macro.

Range("b3") = "=MIN(if(a2:a100>0,a2:a100))"
 
Reply With Quote
 
 
 
 
=?Utf-8?B?V2lnaQ==?=
Guest
Posts: n/a
 
      11th Aug 2007
The best starting point is to put the Macro recorder on (Tools > Macro...)
then enter the formula, then turn off the Macro recorder. Have a look at the
code it generated in a new module.


--
Wigi
http://www.wimgielis.be = Excel/VBA, soccer and music


"ezil" wrote:

> The following array formula is working when directly written in cell. But I
> have to do
> this through a macro. How to write the following command line correctly in a
> macro.
>
> Range("b3") = "=MIN(if(a2:a100>0,a2:a100))"

 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      11th Aug 2007
Range("b3").Value = activesheet.Evaluate("MIN(IF(A2:A100>0,A2:A100))")

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"ezil" <(E-Mail Removed)> wrote in message
news:AD1275CF-EBF1-4AD1-9A05-(E-Mail Removed)...
> The following array formula is working when directly written in cell. But
> I
> have to do
> this through a macro. How to write the following command line correctly in
> a
> macro.
>
> Range("b3") = "=MIN(if(a2:a100>0,a2:a100))"



 
Reply With Quote
 
=?Utf-8?B?TWlrZSBI?=
Guest
Posts: n/a
 
      11th Aug 2007
or


Range("b3").Select
Selection.FormulaArray = "=MIN(if(a2:a100>0,a2:a100))"

Mike
"ezil" wrote:

> The following array formula is working when directly written in cell. But I
> have to do
> this through a macro. How to write the following command line correctly in a
> macro.
>
> Range("b3") = "=MIN(if(a2:a100>0,a2:a100))"

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Array formula does not calculate correctly when run from macro downwitch Microsoft Excel Programming 10 22nd Feb 2010 04:19 AM
Macro formula array return limits? twaddell Microsoft Excel Programming 4 12th Aug 2009 10:00 AM
Formula Array Macro GregK Microsoft Excel Programming 5 31st Mar 2008 03:17 PM
Writing Array formula through macro =?Utf-8?B?U2hpbHBz?= Microsoft Excel Programming 11 21st Jun 2007 09:32 AM
formula array in a macro =?Utf-8?B?VGFueWE=?= Microsoft Excel Programming 3 16th May 2007 11:47 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:34 PM.