Running macro from a worksheet

sdohertyccb

Board Regular
Joined
Feb 15, 2005
Messages
91
I know this should be a fairly easy answer, but I am having a "brain cramp" on this. I want a sub to run on a worksheet when the workbook calculates. I have the macro in the worksheet module (I have tested it and it runs fine when I manually run it), but it doesn't seem to fire when I run the reports (lots of other macros and forms). I want this routine to execute as the file is saving but before the program prints. Is there an event comand that I should be using? Any thoughts?
Thanks in advance for your help.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Try like this in the sheet's code module

Code:
Private Sub Worksheet_Calculate()
'code to call your macro
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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