Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

recalculate on a command button

Status
Not open for further replies.

caerdydd

Programmer
Mar 2, 2004
35
GB
Hi all,
Having problems on something that i initially thought was simple, recalculating a bunch of values based on the excel functions when i press a button. I have tried various ways but it never works.
I have at the mo....

Private Sub Workbook_Open()
Application.Calculation = xlCalculationManual
End Sub
Private Sub CommandButton1_Click()
Application.Calculate
End Sub

i have also tried a for each in active workbook.....calculate but still no joy.
Would anyone be able to tell me what i am doing wrong? Thanks
 
I have no idea why
Application.calculate
would not work - it is perfectly viable syntax. Is it possible that it is a long recalc and simply hasn't completed by the time you select another cell (this interupts calculation btw)

Rgds, Geoff

"Having been erased. the document thjat you are seeking. Must now be retyped"

Please read FAQ222-2244 before you ask a question
 
No reason why it should be any different but have you tried Application.CalculateFull as well? This should force a full recalc of all open workbooks.

Regards
Ken.................


----------------------------------------------------------------------------
[peace]It's easier to beg forgiveness than ask permission[2thumbsup]

----------------------------------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top