to create a formula by removing RC[number]

P

pol

I am using the following forumula in a macro.

ActiveCell.FormulaR1C1 =

"=IF(COUNTIF([item.xls]item!C[-11],RC[-6]),VLOOKUP(RC[-6],[item.xls]Item!C[-11]:C[-1],11,0),0)"
. Here RC[-6]) is G7 column. So I have to write the same formula to work
from any column which is active cell.
I wrote the same formula as follows to enable to work from any of the column

=IF(COUNTIF([item.xls]item!B:B,G7),VLOOKUP(G7,[item.xls]item!B:L,11,0),0).
But the G7 value will be shown as 'G7' so #item# error is showing ie the
formula is coming wrongl
=IF(COUNTIF([item.xls]item!B:B,'G7'),VLOOKUP('G7',[item.xls]item!B:L,11,0),0).

It would be very helpful if anybody can help to solve this problem

With thanks
Pol
 
D

Dave Peterson

Check your other post.
I am using the following forumula in a macro.

ActiveCell.FormulaR1C1 =

"=IF(COUNTIF([item.xls]item!C[-11],RC[-6]),VLOOKUP(RC[-6],[item.xls]Item!C[-11]:C[-1],11,0),0)"
. Here RC[-6]) is G7 column. So I have to write the same formula to work
from any column which is active cell.
I wrote the same formula as follows to enable to work from any of the column

=IF(COUNTIF([item.xls]item!B:B,G7),VLOOKUP(G7,[item.xls]item!B:L,11,0),0).
But the G7 value will be shown as 'G7' so #item# error is showing ie the
formula is coming wrongly
=IF(COUNTIF([item.xls]item!B:B,'G7'),VLOOKUP('G7',[item.xls]item!B:L,11,0),0).

It would be very helpful if anybody can help to solve this problem

With thanks
Pol
 

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

Top