ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Put a formula to a cell with macro and it doesent calculate. (Excel localisation problem?) (https://www.excelbanter.com/excel-programming/359380-put-formula-cell-macro-doesent-calculate-excel-localisation-problem.html)

[email protected]

Put a formula to a cell with macro and it doesent calculate. (Excel localisation problem?)
 
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


[email protected]

Put a formula to a cell with macro and it doesent calculate. (Excel localisation problem?)
 
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)"



All times are GMT +1. The time now is 08:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com