I'm not sure what error(s) you are getting. The code worked for me yesterday. Do you understand the idea (even if there is something wrong with the specific syntax presented)? The idea is to use either the seriescollection.add or seriescollection.newseries methods to add series to the chart.
The number of iterations on column O is variable. Meaning that I can't simply copy the values Q:R and past them below the last values of O:P.
I'm not sure I understand this restriction. I see no programmatic reason why your macro could not append one or more entries from Q:R to the O:P columns, so this limitation must be something you are imposing on the code/spreadsheet that I don't understand. Programmatically, something like:
Should append the first Q:R entry at the end of the O:P set of data. You have suggested that this would be disallowed, though, but I am not sure why this is disallowed.
On further consideration, If you don't need the two sections of line formatted differently, appending all of the Q:R data onto the end of the O:P data might be the easiest overall way to do this. It will avoid the need to add a second data series to the chart, which will simplify chart creation. Why are you disallowed from appending the Q:R data onto the O:P data? If it's just about "O:P is variable length", good programming structure should allow the macro to keep track of where the O:P data ends and the Q:R data begins, so that should not prevent appending the two data sets into one.
Bookmarks