how to prevent a worksheet from being recalculated?

Z

z.entropic

I have a complex nonlinear regression worksheet/workbook in which the results
are written by a button-activated macro into another (summary) worksheet. It
takes a while for the worksheet to be calculated and the results written, but
it's even worse than the worksheet recalculation happens again after the
summary data have been written... Is there a VBA procedure that would
prevent the recalculation from happening unless a value in a given cell is
chaned?

z.entropic
 
C

Chip Pearson

There isn't anything built into Excel to that. If you are talking about
having a cell value changed either manually or via VBA code (as opposed to
the change as a result of calculated formula), you could set the calculation
to manual and then use a Worksheet_Change event to do a calculation when the
cell is changed.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Application.Calculate
End If
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)
 

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

Top