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
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