K
kuhni
Hi everybody,
I have a little problem concerning Formulas in Excel VBA.
I want to insert the following code into an cell using VBA:
=GETPIVOTDATA("Cost ";'Reports.xls'pivotYear;"Year";2003)
Of course, I want to create this statement generic, e.g.:
Range("G5").FormulaR1C1 = "=GETPIVOTDATA(""" & pos &
""";'Reports.xls'!" & pivot & ";""Year"";2003)"
I have tested the syntax of the string and it is identically to the
string above. The problem is now that I receive an error message when
it comes to this statement: Range("G5").FormulaR1C! = "..."
Error message: Application-defined or Object-defined error
I would be very grateful, if somebody could help me how to do it
properly! THANKS!
Best wishes,
Stephan
I have a little problem concerning Formulas in Excel VBA.
I want to insert the following code into an cell using VBA:
=GETPIVOTDATA("Cost ";'Reports.xls'pivotYear;"Year";2003)
Of course, I want to create this statement generic, e.g.:
Range("G5").FormulaR1C1 = "=GETPIVOTDATA(""" & pos &
""";'Reports.xls'!" & pivot & ";""Year"";2003)"
I have tested the syntax of the string and it is identically to the
string above. The problem is now that I receive an error message when
it comes to this statement: Range("G5").FormulaR1C! = "..."
Error message: Application-defined or Object-defined error
I would be very grateful, if somebody could help me how to do it
properly! THANKS!
Best wishes,
Stephan