Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Detect when Active Cell Changes

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.SeriesC ollection(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



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Detect when Active Cell Changes

Use the Selection_Change event.

--
David Hager
Excel MVP

"GarethG" wrote in message
...
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.SeriesC ollection(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



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



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
Row select mode to highlight active row of active cell Bart Fay[_2_] Excel Discussion (Misc queries) 0 May 11th 10 09:34 PM
referring to formula in a non active cell from active cell nickname Excel Discussion (Misc queries) 1 June 21st 07 12:11 PM
Is there a function to detect changes in any given cell? Detecting Cell Value Changes Excel Worksheet Functions 1 January 2nd 05 11:16 PM
Need to detect cell shading John Wilson Excel Programming 0 September 10th 03 05:43 PM
Need to detect cell shading Tom Ogilvy Excel Programming 0 September 10th 03 05:43 PM


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

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"