Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'd like to get hold of an object or collection representing the
(possibly multiple) charts that the user has selected. If the user has only one chart selected then 'Application.Selection' returns a 'ChartArea' object and 'Application.ActiveChart' returns a 'Chart' object, both of which would be fine. However, if the user has more than one chart selected then 'Application.Selection' returns a 'ChartObjects' collection representing all the charts on the sheet (not just the ones selected) while 'Application.ActiveChart' returns 'Nothing'. I can't find a 'ChartObject.Active' or 'ChartObject.Selected' method that would allow me to determine which of the "ChartObjects' collection returned from 'Application.Selection'. Any ideas? Thanks, James |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It is not a good idea to rely on selected charts, far better to give them
meaningful names and use those names Here is some code to iterate them all Dim chrt As ChartObject For Each chrt In ActiveSheet.ChartObjects MsgBox chrt.Name Next chrt -- __________________________________ HTH Bob "James" wrote in message ... I'd like to get hold of an object or collection representing the (possibly multiple) charts that the user has selected. If the user has only one chart selected then 'Application.Selection' returns a 'ChartArea' object and 'Application.ActiveChart' returns a 'Chart' object, both of which would be fine. However, if the user has more than one chart selected then 'Application.Selection' returns a 'ChartObjects' collection representing all the charts on the sheet (not just the ones selected) while 'Application.ActiveChart' returns 'Nothing'. I can't find a 'ChartObject.Active' or 'ChartObject.Selected' method that would allow me to determine which of the "ChartObjects' collection returned from 'Application.Selection'. Any ideas? Thanks, James |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel charts will not go back to Landscape when selected | Excel Discussion (Misc queries) | |||
Multiple cells or columns are selected instead of selected cell or | Excel Discussion (Misc queries) | |||
Looping through selected charts | Excel Programming | |||
charts and cells black out when selected | Excel Discussion (Misc queries) | |||
I have charts that are only visible when selected, how do I fix? | Charts and Charting in Excel |