View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default To run the formula from any active cell

Hi,

Maybe this

ActiveCell.Formula =
"=IF(COUNTIF([item.xls]item!B:B,G7),VLOOKUP(G7,[item.xls]item!B:L,11,0),0)"

Mike

"pol" wrote:

In my macros I wrote the formula as follows.
ActiveCell.FormulaR1C1 =
"=IF(COUNTIF([item.xls]item!C[-11],RC[-6]),VLOOKUP(RC[-6],[item.xls]Item!C[-11]:C[-1],11,0),0)"

the output formula would be as like this:
=IF(COUNTIF([item.xls]item!B:B,G7),VLOOKUP(G7,[item.xls]item!B:L,11,0),0).

So is it possible to write the formula the same as that of seconed formula
in my macro.Becuuse I need to run the formula from any active cell which may
be L7 or M7. So please help me to write that formula to enable to run from
any active cell.
With thanks
Pol