Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
obts1434
 
Posts: n/a
Default 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   Report Post  
Jon Peltier
 
Posts: n/a
Default


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
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
Urgent Chart Assistance Brent E Charts and Charting in Excel 1 May 10th 05 09:09 AM
Urgent Chart Questions Brent E Excel Discussion (Misc queries) 0 May 9th 05 11:01 PM
Urgent Chart Assistance Requested Brent E Excel Discussion (Misc queries) 0 May 9th 05 11:01 PM
Scrollbar on Chart Jumps to Left when Chart is Clicked Bob Charts and Charting in Excel 5 May 1st 05 02:06 AM
pivot table multi line chart souris Charts and Charting in Excel 2 December 7th 04 04:56 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"