L
Ladymuck
I would like to insert a pie chart where the source data is on the active
worksheet but comes from two discontiguous ranges (eg B2:C10 and B15:C15).
I have two ranges GBData, for the first range, and NonGBData for the second
range.
The following code sets the source data as B2:C15, which is incorrect. How
can I amend it to create the chart with only the data I want?
WShtName = ActiveSheet.Name
Charts.Add
ActiveChart.ChartType = xlPie
ActiveChart.SetSourceData Source:=Sheets(WShtName).Range( _
GBData.Address, NonGBData.Address), PlotBy:=xlColumns
ActiveChart.Location Where:=xlLocationAsObject, Name:=WShtName
Many thanks for any suggestions, happy New Year!
worksheet but comes from two discontiguous ranges (eg B2:C10 and B15:C15).
I have two ranges GBData, for the first range, and NonGBData for the second
range.
The following code sets the source data as B2:C15, which is incorrect. How
can I amend it to create the chart with only the data I want?
WShtName = ActiveSheet.Name
Charts.Add
ActiveChart.ChartType = xlPie
ActiveChart.SetSourceData Source:=Sheets(WShtName).Range( _
GBData.Address, NonGBData.Address), PlotBy:=xlColumns
ActiveChart.Location Where:=xlLocationAsObject, Name:=WShtName
Many thanks for any suggestions, happy New Year!