Put a formula to a cell with macro and it doesent calculate. (Excel localisation problem?)

  • Thread starter Thread starter peterfarge
  • Start date Start date
P

peterfarge

Hello NG,

I want to put a formula to a cell:
oWorksheet.Cells(2, 2).FormulaR1C1 =
"=VLOOKUP(RC[-1],Table2!A:B,2,FALSE)"

If I excecute this line and look at the cell than there is written
"#Name?". If I click in the cell I see the formula translated to
German. (The German word for VLOOKUP is SVERWEIS.) If I press Return
the correct value is displayed. The formula is still in the cell. The
result of the formula is written in the sheet.

How can I refresh the cells automitcally?

I think the problem is the translation to the German Excel language. If
I take this formula:
oWorksheet.Cells(2, 2).FormulaR1C1 = "=A1*100"

The correct value is displayed immediatly...


Regards

Peter
 
It was a fault in the formula. If I press in a cell return, Excel doese
correct it.

Correct formula: "=VLOOKUP(RC[-1],Table2!C1:C2,2,FALSE)"
 

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