View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default VLOOKUP problem using VBA

I'm an idiot. Didn't spot that you had mixed up R1C1 references and A1
refernces in a FormukaR1C1.

Use

Columns("E:E").Insert Shift:=xlToRight
lastrow1 = Cells(Rows.Count, "D").End(xlUp).Row
Range("E" & lastrow1 & ":E2").FormulaR1C1 = _
"=NOT(ISNUMBER(MATCH(RC[-1],'PET BDC - Design Phase Dev'!C4,0)))"


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"matpj" wrote in
message ...

it does indeed!

but then when I stop the macro and go into the cell that has the
formula in and press enter, it kind of kicks the formula into gear and
it works.

I have a range of data containing about 50 rows, of which there are
about 5 instances where your formula would return false rather than
true.

when the macro inserts the formula everything is true.
If I then go to those ones I KNOW are false and select the cell and
then press enter it suddenly changes to "FALSE"

the same if I drag the formula down to cover all ranges, all of those
false ones suddenly appear..

I don't understand why its doing this.


--
matpj
------------------------------------------------------------------------
matpj's Profile:

http://www.excelforum.com/member.php...o&userid=21076
View this thread: http://www.excelforum.com/showthread...hreadid=537145