formula

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
I want to add a formula into a sheet
I use this line
wksSheet.Range("c6").Formula = "=SUM(c1:c5)

That inserts the formula but doesn't calculate it.
What's wrong with it

Thank you
 
Hi
you may check 'Tools - Option - Calculate' that automatic calculation
is enabled.

Another way would be to add the line
application.calculate
after your insertion
 
Make sure your Tools/Options Calculation tab is set to Automatic. Also
wksSheet needs to be Dim as a variable or identified as Sheets("Sheet1") or
Sheet(1) or whatever the name is.
Mike
 
doesn't calculate it or displays it as

=SUM(c1:c5)

If the latter, make sure the cell isn't formatted as text. Also make sure
you are not in formula view - tools=>options, view tab, unselect formulas

Also make sure you are on a worksheet and not a macro sheet.
 

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