• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 359
  • Last Modified:

Writing formula in cell with VBA


I need to update the formulas i a large number of similar files, and have written a small routine to update cells with an new formula..

The line

Range("R9").Formula = "=SUMMERPRODUKT($K$15:$K$108;R15:R108;$I$15:$I$108)"

fails, and returns the message "Application-defined or object-defined error", but I don't understand why..

The SUMMERPRODUKT is the Norwegian version of SUMPRODUCT

Please help.. :)
1 Solution
Good Morning,

Try replacing semi colons ; with commas ,
Rory ArchibaldCommented:
Formula expects a US style formula:
Range("R9").Formula = "=SUMPRODUCT($K$15:$K$108,R15:R108,$I$15:$I$108)"

Open in new window

or you can perhaps use FormulaLocal:
Range("R9").FormulaLocal = "=SUMMERPRODUKT($K$15:$K$108;R15:R108;$I$15:$I$108)"

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now