array formula in macro

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

Guest

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))"
 
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.
 
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)
 

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