Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Event Macro Calculate Does Not Work
I need a macro to run the application "EnterTitle" any time the workbook is
recalculated, whether it be manually using F9, or automatically, when any cell changes if the calculation mode is in automatic. I entered the following syntax by right-clicking the Excel logo and selecting "View Code" but this does not work. Sub Workbook_Calculate(ByVal Sh As Object) Application.Run "EnterTitle" End Sub Thanks in advance. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Event Macro Calculate Does Not Work
Try
Sub Workbook_SheetCalculate(ByVal Sh As Object) Application.Run "EnterTitle" End Sub Hope this helps Rowan "Carl Bowman" wrote: I need a macro to run the application "EnterTitle" any time the workbook is recalculated, whether it be manually using F9, or automatically, when any cell changes if the calculation mode is in automatic. I entered the following syntax by right-clicking the Excel logo and selecting "View Code" but this does not work. Sub Workbook_Calculate(ByVal Sh As Object) Application.Run "EnterTitle" End Sub Thanks in advance. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Event Macro Calculate Does Not Work
Next time you're in the VBE, click on ThisWorkbook (or do the same rightclick on
the excel logo and select view code). On the right hand side window above the code window, you'll see two dropdown boxes. Choose Workbook from the left hand side box. Now look through the list of events inside that right hand side dropdown. You won't see a workbook_calculate event. But you will see this: Private Sub Workbook_SheetCalculate(ByVal Sh As Object) You can't make up your own events. But you can tie into the correct one <bg. Option Explicit Private Sub Workbook_SheetCalculate(ByVal Sh As Object) Application.Run "EnterTitle" End Sub But if "entertitle" is in that same project, you can just call it: Option Explicit Private Sub Workbook_SheetCalculate(ByVal Sh As Object) Call EnterTitle 'or even EnterTitle 'but not both! End Sub Carl Bowman wrote: I need a macro to run the application "EnterTitle" any time the workbook is recalculated, whether it be manually using F9, or automatically, when any cell changes if the calculation mode is in automatic. I entered the following syntax by right-clicking the Excel logo and selecting "View Code" but this does not work. Sub Workbook_Calculate(ByVal Sh As Object) Application.Run "EnterTitle" End Sub Thanks in advance. -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Event Macro Calculate Does Not Work
Hi Carl,
Sub Workbook_Calculate(ByVal Sh As Object) I am not aware of this event. The following worked for me: Private Sub Workbook_SheetCalculate(ByVal Sh As Object) Application.Run "EnterTitle" End Sub --- Regards, Norman "Carl Bowman" wrote in message ... I need a macro to run the application "EnterTitle" any time the workbook is recalculated, whether it be manually using F9, or automatically, when any cell changes if the calculation mode is in automatic. I entered the following syntax by right-clicking the Excel logo and selecting "View Code" but this does not work. Sub Workbook_Calculate(ByVal Sh As Object) Application.Run "EnterTitle" End Sub Thanks in advance. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Event Macro Calculate Does Not Work
That worked! Thanks!
"Rowan" wrote: Try Sub Workbook_SheetCalculate(ByVal Sh As Object) Application.Run "EnterTitle" End Sub Hope this helps Rowan "Carl Bowman" wrote: I need a macro to run the application "EnterTitle" any time the workbook is recalculated, whether it be manually using F9, or automatically, when any cell changes if the calculation mode is in automatic. I entered the following syntax by right-clicking the Excel logo and selecting "View Code" but this does not work. Sub Workbook_Calculate(ByVal Sh As Object) Application.Run "EnterTitle" End Sub Thanks in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro doesn't work when used as Workbook Open event | Excel Discussion (Misc queries) | |||
Change event and calculate event | Excel Programming | |||
AFTER Calculate Event | Excel Programming | |||
Sometimes range calculate doesn't work in macro. Why? | Excel Programming |