Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
gvm gvm is offline
external usenet poster
 
Posts: 38
Default triggering macros

I have two macros. I need one to run each time the spreadsheet finishes
recalculation. I need the other one to run each time a particular cell is
changed and I need the spreadsheet to recalculate once it has finished. How
do I do these please?
thanks
Greg
  #2   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default triggering macros

right click on your sheet tab, select view code and use the following event
handlers


Private Sub Worksheet_Calculate()
'Do Something
End Sub


Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
'Do Something
End If
End Sub

Of course, you will need to change the above cell address from $A$1 to
whatever you need.

If your calculation is set to automatic, it should not necessary to
recalculate the worksheet after the Worksheet_Change event (and I believe the
worksheet will recalculate before the Workhseet_Change event fires). If you
need to recalculate, you can use Target.Parent.Calculate or
Application.CalculateFull (to recalculate the entire workbook).




"gvm" wrote:

I have two macros. I need one to run each time the spreadsheet finishes
recalculation. I need the other one to run each time a particular cell is
changed and I need the spreadsheet to recalculate once it has finished. How
do I do these please?
thanks
Greg

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
Userform combo box triggering macros michaelberrier Excel Discussion (Misc queries) 6 June 10th 06 01:25 PM
Triggering an excel menu using macros Sassy[_3_] Excel Programming 0 July 9th 05 12:18 AM
Triggering Verification Function francislee Excel Programming 3 June 3rd 04 08:25 AM
Triggering Macro Execution Peter M[_3_] Excel Programming 1 January 12th 04 08:20 PM
triggering different macros from list box? hammer Excel Programming 9 October 14th 03 10:37 PM


All times are GMT +1. The time now is 11:30 PM.

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

About Us

"It's about Microsoft Excel"