poweraspect1
New Member
- Joined
- Aug 20, 2015
- Messages
- 2
Hello,
I am entirely new to VBA having never coded anything before. I am attempting to create a macro which will create an XY Scatterplot embedded in an existing sheet. I have searched around for several hours now and pieced together quite a few half-solutions that don't quite work or mesh together very well. There seems to be a plethora of ways to create the chart and define it's characteristics and I am spinning my wheels now.
The relevant points are below:
In the example below I show the desired chart I would like VBA to produce. I would like it to be located in the range B19:O39 on the "Blue" sheet. The Blue sheet would be the active sheet the macro is run from. Data is pulled for the Blue and Green series from the active sheet and the red series from the "Red" sheet.
If additional info is required please let me know and I will update this post.
All suggestions are greatly appreciated! While a finished code would be wonderful I'm hoping any answers could help to explain what each line actually does so I can develop and adapt the solution myself. Also if anyone knows of a good learners book for VBA I can pick up for future use I'd love the suggestions.
[/URL][/IMG]
[/URL][/IMG]
I am entirely new to VBA having never coded anything before. I am attempting to create a macro which will create an XY Scatterplot embedded in an existing sheet. I have searched around for several hours now and pieced together quite a few half-solutions that don't quite work or mesh together very well. There seems to be a plethora of ways to create the chart and define it's characteristics and I am spinning my wheels now.
The relevant points are below:
- I will have 3 or more distinct series with their own X and Y values.
- Some series data is stored in the same sheet as I want the plot to be in and some on separate sheets of the same workbook.
- I must be able to define the series names in the code (not a cell reference).
- The plot needs to be placed in a precise location within the sheet.
- The plot size must be defined in the code.
- The plot needs to have the series colors formatted as I see fit.
- The plot must have the title and both the x and y axis names defined.
- A legend must be included
- I will run this in multiple workbooks which have the same sheet names and data format/location.
In the example below I show the desired chart I would like VBA to produce. I would like it to be located in the range B19:O39 on the "Blue" sheet. The Blue sheet would be the active sheet the macro is run from. Data is pulled for the Blue and Green series from the active sheet and the red series from the "Red" sheet.
If additional info is required please let me know and I will update this post.
All suggestions are greatly appreciated! While a finished code would be wonderful I'm hoping any answers could help to explain what each line actually does so I can develop and adapt the solution myself. Also if anyone knows of a good learners book for VBA I can pick up for future use I'd love the suggestions.
Last edited: