Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello
After creating a new, dynamic pivot table (contents varies) I need to add a chart - but can´t figure out how to set the source. None of these tries work. Help appreciated! regards ulf With ActiveSheet.ChartObjects.Add _ (Left:=500, Width:=375, Top:=75, Height:=225) ' .SetSourceData Source:=ActiveSheet.PivotTables("PivotAge") ' .SetSourceData Source:=ActiveSheet.Range("C10") ' .SetSourceData Source:=.Range("C10") .SetSourceData Source:=Sheets("Age").Range("C10") .Chart.ChartType = xlXYScatterLines End With |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Your With block referenced the chart object, but .SetSourceData needs a
chart. This will work: With ActiveSheet.ChartObjects.Add _ (Left:=500, Width:=375, Top:=75, Height:=225).Chart .SetSourceData Source:=ActiveSheet.Range("C10") End With - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ ulfb wrote: Hello After creating a new, dynamic pivot table (contents varies) I need to add a chart - but can´t figure out how to set the source. None of these tries work. Help appreciated! regards ulf With ActiveSheet.ChartObjects.Add _ (Left:=500, Width:=375, Top:=75, Height:=225) ' .SetSourceData Source:=ActiveSheet.PivotTables("PivotAge") ' .SetSourceData Source:=ActiveSheet.Range("C10") ' .SetSourceData Source:=.Range("C10") .SetSourceData Source:=Sheets("Age").Range("C10") .Chart.ChartType = xlXYScatterLines End With |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It certainly does. Thank you!
/ulf "Jon Peltier" wrote: Your With block referenced the chart object, but .SetSourceData needs a chart. This will work: With ActiveSheet.ChartObjects.Add _ (Left:=500, Width:=375, Top:=75, Height:=225).Chart .SetSourceData Source:=ActiveSheet.Range("C10") End With - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ ulfb wrote: Hello After creating a new, dynamic pivot table (contents varies) I need to add a chart - but can´t figure out how to set the source. None of these tries work. Help appreciated! regards ulf With ActiveSheet.ChartObjects.Add _ (Left:=500, Width:=375, Top:=75, Height:=225) ' .SetSourceData Source:=ActiveSheet.PivotTables("PivotAge") ' .SetSourceData Source:=ActiveSheet.Range("C10") ' .SetSourceData Source:=.Range("C10") .SetSourceData Source:=Sheets("Age").Range("C10") .Chart.ChartType = xlXYScatterLines End With |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2007 pivot table source table | Excel Discussion (Misc queries) | |||
entry removed from source table remains in pivot table pull down | Excel Worksheet Functions | |||
Activechart.SetSourceData Source??? | Excel Programming | |||
OfficeXP "Cannot open pivot table source file" when refreshing pivot table | Excel Programming | |||
Help required with setting up a pivot table with the source on sheet1 to have the pivot table created on sheet called "report" | Excel Programming |