Macro to display ERROR if sheet not calculated

Simmo1313

New Member
Joined
May 4, 2015
Messages
39
Hi all,

Looking for what I assume would be a relatively simple macro but I am very new to VBA so don't know how to do it myself.

I have a large spreadsheet that is too bulky to run on auto calculate formulas so we leave it in manual.

I have made a push button that calculates the page but was hoping there was a way I could display in a cell somewhere anytime a change to the inputs of the sheet are made and calculate is not the last function the spreadsheet has completed.

There are 20+ sheets on the page but I would only need the display visible on our "INPUTS1" page.

any help would be greatly appreaciated
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Where are your inputs at (What Cells or ranges)?

You can probably use a worksheet change event to determine when one off these cells has been changed....

When the Worksheet change event fires you could put in a specific cell what cell was changed as well as a timestamp

You could also add a timestamp to the calculate button so you would know the last time the sheet was calculated...
 
Upvote 0
Thanks you for replying

There are inputs on a lot of different pages so it might be hard with that approach.

I was hoping there might be a way of tracking what the last function performed was and if it wasn't "calculate" then display text in a cell.

If that's not possible then adding a time stamp to the calculate function would probably be the next best solution. How would I go about that?

Much appreciated
 
Upvote 0
Calculate is a Method of the Worksheet object. It's not a function. (Calculate is a DAX function which relates to PowerPivot , but based on your description I don't think this is what your referring too)

There is a property of the Application Object called Caller which will tell you from what button a sub procedure is called. Would this be any help?

Another Idea is to have a change log sheet that logs all changes that are made....before value...after value...timestamp of when the change occurred.

Are you using code similar to this?:

Code:
[COLOR=#0000ff]Sub[/COLOR][COLOR=#000000] CalcBook()[/COLOR]    
[COLOR=#0000ff]    Dim[/COLOR] wks [COLOR=#0000ff]As [/COLOR]Worksheet
    Application.Calculation = xlManual
  [COLOR=#0000ff]  For Each[/COLOR] wks [COLOR=#0000ff]In[/COLOR] ActiveWorkbook.Worksheets
        wks.Calculate
    [COLOR=#0000ff]Next[/COLOR]
   [COLOR=#0000ff] Set[/COLOR] wks =[COLOR=#0000ff] Nothing[/COLOR]
[COLOR=#0000ff]End Sub[/COLOR]
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,174
Messages
6,129,296
Members
449,498
Latest member
Lee_ray

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top