Msg Box Appears multiple times due to worksheet calculations

apnovice

New Member
Joined
Aug 23, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I have a workbook that auto refreshes whenever a new date is inputed into a certain cell. This triggers 8 different database queries that returns data to different sheets. Each time a query is complete, that sheet calculates. I have a message box that says "report done" but it keeps popping up multiple times which I assume is because its running every time there is a worksheet calculation. I added a code I found off the internet to try and prevent the msg box from running until all workbook calculations are complete but still have no luck. The below code is in the ThisWorkbook part in vba. Any help would be much appreciated. Thanks!

Private Sub Worksheet_Calculate()
MsgBox "Report Has Completed", vbInformation, "Thermo Fisher Scientific"
Do
Loop Until Application.CalculationState = xlDone
End Sub
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Put this in the worksheet you are inputting the data to.
VBA Code:
Private Sub Worksheet_Calculate()
Calculate
MsgBox "Report Has Completed", vbInformation, "Thermo Fisher Scientific"
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,787
Messages
6,121,561
Members
449,038
Latest member
Guest1337

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