View Full Version : Solved: Chart Help

05-22-2006, 08:28 AM
I have 6 Charts on a worksheet. I want to change their production/editing to vba. I do not know where to start. I have code on creating charts, but I can not seem to find code on editing charts or do I have to write code to create the entire page?

Jacob Hilderbrand
05-22-2006, 01:46 PM
I would suggest using the macro recorder, then manually making the changes you want, then refer to the code that was created and use that to build the real code.

Or if you have a specific questions you can post it and we can help.

05-25-2006, 08:30 AM
ActiveChart.SeriesCollection(1).Values = Range(Sheets("YTD").Cells(Row, Col), (Sheets("YTD").Cells(Row, LCol)))
ActiveChart.SeriesCollection(1).Name = Sheets("YTD").Cells(Row, 1)
ActiveChart.SeriesCollection(1).XValues = Range(Sheets("YTD").Cells(1, Col), Sheets("YTD").Cells(1, LCol))

Recording macros doesnt really help since there is so much "understood" syntax. Using the above code, this updates the x,y names and data ranges, then I repeat by looping through all the charts. The prerequisite to this is to have a template chart created already.