View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default Write formula with code ...

Sige,

Try splitting that one line into two, like this, to help identify the cause error:

Range("C21", Cells(myRow, myCol)).Select

Selection.FormulaR1C1 = _
"=INDEX(Source;MATCH(R20C1;INDEX(Source;;1);0) " & _
";MATCH(R19C;INDEX(Source;1;0);0))"

Is it the first statement or the second that throws the error?

HTH,
Bernie
MS Excel MVP


"Sige" wrote in message
oups.com...
Hi Bernie,

It is bugging on the first Range.... :o(

XL97?
Sige