Detect when Active Cell Changes

G

GarethG

I use the following code to update a chart in my worksheet:

Sub ChartRow()
Dim mySeries As Series
Dim myItem As PivotItem
Set mySeries =
ActiveSheet.ChartObjects("RowChart").Chart.SeriesCollection(1)
Set myItem = ActiveCell.EntireRow.Cells(1).PivotItem
mySeries.Values = myItem.DataRange
mySeries.Name = myItem.LabelRange
End Sub

What I need is a way of detecting automatically whenever the active
cell has changed, then to execute this code.
The active cell may change by someone scrolling through records using
the cursor keys or by clicking directly with the mouse.

Anyone?
Gareth G
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top