Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Macro for Charts
I am trying to create a Macro to create some charts and I am receiving
and error: Run Time Error '1004' Unable to set the XValues property of the Series class The following is my code Charts.Add ActiveChart.ChartType = xlLineMarkers ActiveChart.Location Whe=xlLocationAsObject, Name:="Sheet5" ActiveChart.SetSourceData Source:=Sheets("Sheet4").Range("A3:A23,C3:C23"), _ PlotBy:=xlColumns ActiveChart.SeriesCollection(1).XValues = "=(Sheet4!A8,A15,A23)" ActiveChart.SeriesCollection(1).Values = _ "=(Sheet4!C9,C16,C24)" ActiveChart.SeriesCollection(1).Name = "=Sheet4!A2" All of the referenced cells have data in worksheet. The Macro is ran from sheet5 Thank you for all of your help |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Macro for Charts
I think you need
Sheet4!A8,Sheet4!A15,Sheet4!A23 instead of Sheet4!A8,A15,A23 Dave D-C wrote: I am trying to create a Macro to create some charts and I am receiving and error: Run Time Error '1004' Unable to set the XValues property of the Series class The following is my code Charts.Add ActiveChart.ChartType = xlLineMarkers ActiveChart.Location Whe=xlLocationAsObject, Name:="Sheet5" ActiveChart.SetSourceData Source:=Sheets("Sheet4").Range("A3:A23,C3:C23") , _ PlotBy:=xlColumns ActiveChart.SeriesCollection(1).XValues = "=(Sheet4!A8,A15,A23)" ActiveChart.SeriesCollection(1).Values = _ "=(Sheet4!C9,C16,C24)" ActiveChart.SeriesCollection(1).Name = "=Sheet4!A2" All of the referenced cells have data in worksheet. The Macro is ran from sheet5 Thank you for all of your help |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to copy Excel charts to existing Powerpoint file | Excel Programming | |||
VBA Code, My excel macro creates the charts on top of each other | Excel Programming | |||
Excel Macro to open file, load & do charts, functional but not usable/not a good prog | Excel Programming | |||
Creating a macro to copy a number of charts from Excel to PPT | Excel Programming | |||
Global macro for resizing and reformatting Excel charts | Excel Programming |