![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Posts: 29
|
Is it possible to create charts with a macro? I have sets of "x" and "y" data on over 100 worksheets and I'd like to quickly make an x-y scatter plot for every single worksheet.
Also, i dont know if it makes a difference, but the number of points is not the same on every worksheet. Thanks! |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
|
It is possible to add charts using VBA. (and very difficult to mess about with if you record a macro to see what the code is.)
To embed a scatter chart on Sheet1 and use B2:C11 as the source data, you would use code like this:
|
|
|
|
|
|
#3 |
|
New Member
Join Date: Mar 2002
Posts: 29
|
Mark,
Thanks alot. This is what I am looking for. Do you (or does anyone) know how I can change the following two parts: - How can I make it refer to x and y values that are in non-adjacent columns? (for the "Range" part) - Is there a way to make it dynamically plot however many points there are (for example, some sheets have 10 points, some have 20, some have hundreds... they are all in the same columns just on different sheets). Please let me know if this is unclear. Thank you all |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|