• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Copying Dynamic Range Chart Does not Preserve Define Range

terrarium

New Member
I've got a workbook of charts in several sheets. Each sheet is the same form and has the same charts. When I make copies of my master template, the dynamic ranges I have in the chart (named ranges) become static references. I want to change the references for each chart back to the named ranges but how can i do this in vba? I was thinking


for x = 1 to worksheetcount

With activecharts.seriescollection(1)

.xvalue = "Sheet1!DatesRange"

end with

next x


but this returns "object not define" and highlights the .xvalue line.


Any ideas? I left my sample at work, but why does the .xvalue property not accept named ranges?
 
The Named Range needs to be in synatax

=WorkbookName!RangeName

so perhaps:

[pre]
Code:
.xValue = "MyWorkbook.xls!DatesRange"
[/pre]
 
Back
Top