spurs
Active Member
- Joined
- Oct 18, 2006
- Messages
- 479
- Office Version
- 2016
- 2013
- 2010
- 2007
- 2003 or older
- Platform
- Windows
I have a workbook that has many worksheets. One of these worksheets is named "Plot" which graphs data.
Right now, whenever I do an entry on the worksheet "Main", I run a macro called "Update" which does all of the calculations needed and updates the workbook. This is a slow process and takes 2 seconds to do all of the updates.
I suspect that I can save a lot of delay time by not doing updates to calculations associated to plot the graph on worksheet "Plot".
What I would like to do is add code to the "Update" macro that recognizes that I am on the worksheet "Main" and am not looking at other worksheets so I want to prevent doing background calculations to update the graphs. However if I move off of worksheet "Main". or "save" the workbook, I want to make sure that the calculations are done.
What are some of the lines of code that I can use to:
a) recognize that I am on worksheet "Main"
b) trigger the macro "Update" when I leave worksheet "Main"
c) recognize that I am saving the workbook and allow "Update" to also do the graphical calculations
Right now, whenever I do an entry on the worksheet "Main", I run a macro called "Update" which does all of the calculations needed and updates the workbook. This is a slow process and takes 2 seconds to do all of the updates.
I suspect that I can save a lot of delay time by not doing updates to calculations associated to plot the graph on worksheet "Plot".
What I would like to do is add code to the "Update" macro that recognizes that I am on the worksheet "Main" and am not looking at other worksheets so I want to prevent doing background calculations to update the graphs. However if I move off of worksheet "Main". or "save" the workbook, I want to make sure that the calculations are done.
What are some of the lines of code that I can use to:
a) recognize that I am on worksheet "Main"
b) trigger the macro "Update" when I leave worksheet "Main"
c) recognize that I am saving the workbook and allow "Update" to also do the graphical calculations