I guess I didn't explain clearly. I can not use a specific reference to the sheet's name (such as shName = "Fall") because every file has a new sheet name, named for the Workbook. They are all different. I used your first example *exactly*, with the exception of " shName = "Fall"" because the sheet name does not equal "Fall". But when I put:
I get runtime error 1004, Parameter not valid. I have included a small sample WS and a sample of the code.
The current code in the sample is another attempt to have the name reference a variable WS name, but it isn't working either. Here's another thought: Is this line
referencing the A2 cell on the page the chart is on (which has nothing in that cell) or the original/first sheet, which, from what I've read, it should recognize as Sheet1?
I have now posted this question elsewhere as well. I don't understand why that is frowned upon (yes I did read the FAQ) because I'm only trying to get an answer. I hope it's not a problem and I wanted to be upfront about it. Thanks.
This is where the question was asked elsewhere: stackoverflow dot com/questions/69309185/vba-excel-reference-variably-named-worksheets-for-chart-series/69309371#69309371
Bookmarks