ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Select chart object in Excel 2007 (https://www.excelbanter.com/excel-programming/396516-select-chart-object-excel-2007-a.html)

Luca Brasi

Select chart object in Excel 2007
 
Is it possible to select an existing chart object using VBA? The chart
should be selected as if I would have clicked on it manually (thick
border around it). In Excel 2007.
Thanks

Tom Ogilvy

Select chart object in Excel 2007
 
activesheet.ChartObjects(1).Select

--
Regards,
Tom Ogilvy


"Luca Brasi" wrote:

Is it possible to select an existing chart object using VBA? The chart
should be selected as if I would have clicked on it manually (thick
border around it). In Excel 2007.
Thanks


Luca Brasi

Select chart object in Excel 2007
 
thanks tom, but this does not select the chart object as if you would
have selected it manually (in Excel 2007). Or does it at your place?? I
have just one Office 2007 installation available for doing some testing.

Tom Ogilvy wrote:
activesheet.ChartObjects(1).Select


Tom Ogilvy

Select chart object in Excel 2007
 
try this instead:

ActiveSheet.ChartObjects(1).Activate
ActiveChart.ChartArea.Select

You can use the name like "Chart 1" instead of the index number in Chart
Objects.

--
Regards,
Tom Ogilvy


"Luca Brasi" wrote:

thanks tom, but this does not select the chart object as if you would
have selected it manually (in Excel 2007). Or does it at your place?? I
have just one Office 2007 installation available for doing some testing.

Tom Ogilvy wrote:
activesheet.ChartObjects(1).Select



Luca Brasi

Select chart object in Excel 2007
 
Tom, great! works!
Many thanks


Tom Ogilvy wrote:
try this instead:

ActiveSheet.ChartObjects(1).Activate
ActiveChart.ChartArea.Select

You can use the name like "Chart 1" instead of the index number in Chart
Objects.



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com