+ Reply to Thread
Results 1 to 2 of 2

triggering macros

  1. #1
    gvm
    Guest

    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. #2
    JMB
    Guest

    RE: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1