Hello,
I am trying to make a pie chart that will have a variable number of items. I am trying to make a dynamic range.
ActiveChart.SetSourceData Source:=Sheets("Sheet2").Range(Sheets("sheet2").Range(Sheets("sheet2").Cells(2, 5), Sheets("sheet2").Cells(1 + eunval, 5)), Sheets("sheet2").Range(Sheets("sheet2").Cells(2, 2), Sheets("sheet2").Cells(1 + eunval, 2))), _
PlotBy:=xlColumns
This works but for some reason it includes data from b2:e4. I only want to use b2:bx and e2:ex (x varies with the # of data types)
ActiveChart.SetSourceData Source:=Sheets("Sheet2").Range(""e2:e" & CStr(1 + eunval) & ","b2:b" & CStr(1 + eunval) & "), _
PlotBy:=xlColumns
The above code does not work at all. It returns "expected: list separated or )"
I am trying to make a pie chart that will have a variable number of items. I am trying to make a dynamic range.
ActiveChart.SetSourceData Source:=Sheets("Sheet2").Range(Sheets("sheet2").Range(Sheets("sheet2").Cells(2, 5), Sheets("sheet2").Cells(1 + eunval, 5)), Sheets("sheet2").Range(Sheets("sheet2").Cells(2, 2), Sheets("sheet2").Cells(1 + eunval, 2))), _
PlotBy:=xlColumns
This works but for some reason it includes data from b2:e4. I only want to use b2:bx and e2:ex (x varies with the # of data types)
ActiveChart.SetSourceData Source:=Sheets("Sheet2").Range(""e2:e" & CStr(1 + eunval) & ","b2:b" & CStr(1 + eunval) & "), _
PlotBy:=xlColumns
The above code does not work at all. It returns "expected: list separated or )"