Applying calculations to values when creating a chart via vba?

sark666

Board Regular
Joined
Jul 30, 2009
Messages
169
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?
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Forum statistics

Threads
1,224,608
Messages
6,179,872
Members
452,949
Latest member
Dupuhini

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top