Results 1 to 20 of 20

Execute macro automatically after cell update

Threaded View

carlwin Execute macro automatically... 12-19-2010, 02:48 AM
pike Re: Execute macro... 12-19-2010, 04:26 AM
carlwin Re: Execute macro... 12-19-2010, 05:38 AM
TMS Re: Execute macro... 12-19-2010, 04:36 AM
carlwin Re: Execute macro... 12-19-2010, 05:39 AM
pike Re: Execute macro... 12-19-2010, 06:08 AM
carlwin Re: Execute macro... 12-19-2010, 05:59 PM
TMS Re: Execute macro... 12-19-2010, 06:14 PM
pike Re: Execute macro... 12-19-2010, 06:24 PM
carlwin Re: Execute macro... 12-19-2010, 07:11 PM
pike Re: Execute macro... 12-19-2010, 07:30 PM
carlwin Re: Execute macro... 12-19-2010, 07:40 PM
carlwin Re: Execute macro... 12-19-2010, 07:57 PM
TMS Re: Execute macro... 12-19-2010, 08:08 PM
carlwin Re: Execute macro... 12-19-2010, 08:28 PM
pike Re: Execute macro... 12-19-2010, 08:09 PM
carlwin Re: Execute macro... 12-19-2010, 08:25 PM
pike Re: Execute macro... 12-19-2010, 08:33 PM
carlwin Re: Execute macro... 12-19-2010, 08:42 PM
pike Re: Execute macro... 12-19-2010, 08:56 PM
  1. #1
    Registered User
    Join Date
    06-18-2010
    Location
    Canberra, Australia
    MS-Off Ver
    Excel 2010
    Posts
    29

    Execute macro automatically after cell update

    The following code only executes after I update the relevant cell (U8) if I click anywhere on the sheet.

    Any ideas on how I can get it to execute automatically after I update this cell?

    Thanks.

    
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    
        Dim celltxt As String
        celltxt = ActiveSheet.Range("U8").Text
        If InStr(1, celltxt, "Calendar Year") Then
                ActiveSheet.ChartObjects("Chart 1").Activate
                ActiveChart.PlotArea.Select
                ActiveChart.SetSourceData Source:=Range("B13:G15")
            Else
                If InStr(1, celltxt, "Half Year") Then
                ActiveSheet.ChartObjects("Chart 1").Activate
                ActiveChart.PlotArea.Select
                ActiveChart.SetSourceData Source:=Range("B13:I15")
            Else
                If InStr(1, celltxt, "Financial Year") Then
                ActiveSheet.ChartObjects("Chart 1").Activate
                ActiveChart.PlotArea.Select
                ActiveChart.SetSourceData Source:=Range("B13:F15")
                
        End If
        End If
        End If
    
    
    End Sub
    Last edited by carlwin; 12-19-2010 at 08:46 PM.

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