Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro doesn't work when used as Workbook Open event Phil Excel Discussion (Misc queries) 2 October 20th 06 02:42 PM
Change event and calculate event Antje Excel Programming 1 March 29th 05 09:03 PM
AFTER Calculate Event PosseJohn Excel Programming 4 January 16th 05 07:31 PM
Sometimes range calculate doesn't work in macro. Why? Don Wiss Excel Programming 3 January 4th 05 05:37 PM


All times are GMT +1. The time now is 09:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"