I've never really ventured into creating charts via vba, so I recorded a macro and just working from there.
The default way it applies a value:
ActiveChart.SeriesCollection(1).Values = "=Sheet1!R2C10"
And I know you can interject variables for the row/column reference like so:
ActiveChart.SeriesCollection(x).Values = "=Sheet1!R" & x + 1 & "C10"
But what I need to do is do some math between a couple of cells for the result. I could write the results prior somewhere else on a sheet or hidden but that seems clunky. Is there a means of working with multiple ranges/variables and return a result to the assignment of a series value?
Btw, I wish they just used the normal Range or Cells syntax for this. Is there some reason for the row/column reference when assigning chart values?
The default way it applies a value:
ActiveChart.SeriesCollection(1).Values = "=Sheet1!R2C10"
And I know you can interject variables for the row/column reference like so:
ActiveChart.SeriesCollection(x).Values = "=Sheet1!R" & x + 1 & "C10"
But what I need to do is do some math between a couple of cells for the result. I could write the results prior somewhere else on a sheet or hidden but that seems clunky. Is there a means of working with multiple ranges/variables and return a result to the assignment of a series value?
Btw, I wish they just used the normal Range or Cells syntax for this. Is there some reason for the row/column reference when assigning chart values?