Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default array formula in macro

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:a1000,a2:a100))"
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default array formula in macro

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:a1000,a2:a100))"

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default array formula in macro

Range("b3").Value = activesheet.Evaluate("MIN(IF(A2:A1000,A2:A100))")

--
HTH

Bob

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

"ezil" wrote in message
...
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:a1000,a2:a100))"



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default array formula in macro

or


Range("b3").Select
Selection.FormulaArray = "=MIN(if(a2:a1000,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:a1000,a2:a100))"

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
Array formula: how to join 2 ranges together to form one array? Rich_84 Excel Worksheet Functions 2 April 1st 09 06:38 PM
Writing Array formula through macro Shilps[_2_] Excel Programming 11 June 21st 07 09:32 AM
formula array in a macro Tanya Excel Programming 3 May 16th 07 11:47 AM
copy one array formula to an array range guedj54 Excel Programming 2 October 29th 06 07:38 PM
Tricky array formula issue - Using array formula on one cell, then autofilling down a range aspenbordr Excel Programming 0 July 27th 05 03:59 PM


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

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

About Us

"It's about Microsoft Excel"