Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Capture chart elements in VB
Is there anyway, if I have an existing chart that is formatted already, to
capture the all elements of that chart in VB (by recording a macro perhaps)? Have a spreadsheet that contains hundreds of charts, all of which are the same format, but due to non-adjacent data sources and multiple chart types within one chart, it's very tempermental - need to standardize. Also, is there a list contained within a spreadsheet of all components of that spreadsheet? Primarily trying to capture the chart names to utilize in VB coding without having to start recording a macro and then selecting each and every chart. |
#2
|
|||
|
|||
Is there anyway, if I have an existing chart that is formatted already, to capture the all elements of that chart in VB (by recording a macro perhaps)? You want to capture the formats? You can copy a chart, then paste special as formats only. This overwrites your chart title and axis titles, so in a VBA procedure, you should store these text items in string variables, then copy-paste the format, then reapply the titles. This might be a use for user-defined chart types, as well: http://peltiertech.com/Excel/ChartsH...stomTypes.html Again, note that the titles are hosed. Have a spreadsheet that contains hundreds of charts, all of which are the same format, but due to non-adjacent data sources and multiple chart types within one chart, it's very tempermental - need to standardize. Also, is there a list contained within a spreadsheet of all components of that spreadsheet? Primarily trying to capture the chart names to utilize in VB coding without having to start recording a macro and then selecting each and every chart. To get a list of chart object names: For Each chobChartObject in ActiveSheet.ChartObjects Debug.Print chobChartObject.Name Next To run a macro on each embedded chart For Each chobChartObject in ActiveSheet.ChartObjects With chobChartObject.Chart ' your code goes here End With Next - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Urgent Chart Assistance | Charts and Charting in Excel | |||
Urgent Chart Questions | Excel Discussion (Misc queries) | |||
Urgent Chart Assistance Requested | Excel Discussion (Misc queries) | |||
Scrollbar on Chart Jumps to Left when Chart is Clicked | Charts and Charting in Excel | |||
pivot table multi line chart | Charts and Charting in Excel |