ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   Referencing chart sheets in vba (https://www.excelbanter.com/charts-charting-excel/68837-referencing-chart-sheets-vba.html)

The Big Smelly Ogre

Referencing chart sheets in vba
 
I asked this question in the programming forum but got no replies, so I'll
try it here.

I'm trying to adapt some code (from Jon Peltier's website) to scale chart
axes based on cell contents. I can get the code to work for charts embedded
in the active worksheet and other worksheets, but I can't figure out how to
reference a chart that is on it's own sheet. How is this done?

Here is the type of code I'm working with:

ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlCategory) _
.MaximumScale = Target.Value

Can anyone help me?


The Big Smelly Ogre

Referencing chart sheets in vba
 
Never mind. i figured it out. You have to use the CHARTS property.

"The Big Smelly Ogre" wrote:

I asked this question in the programming forum but got no replies, so I'll
try it here.

I'm trying to adapt some code (from Jon Peltier's website) to scale chart
axes based on cell contents. I can get the code to work for charts embedded
in the active worksheet and other worksheets, but I can't figure out how to
reference a chart that is on it's own sheet. How is this done?

Here is the type of code I'm working with:

ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlCategory) _
.MaximumScale = Target.Value

Can anyone help me?



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

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