Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programatically changing the chart datapoints
Guys,
I am having an excel template with a chart having 15 pre-defined datapoints. I am trying to set the co-ordinates of the datapoints depending upon the data entered, through a micro. It throughs user an error "Unable to get series collection property of chart class". I found that, when user use this template, the datapoint somehow get deleted, which might be leading to this error. Any help is appreciated. Pasting the code here for your reference. ------------ Do Until (dataID = 19) s Charts("Chart Q1").SeriesCollection(dataID).Name = Sheets(3).Range("B" & sheet3Count)' This is where error points If (IsError(Sheets(3).Range("G" & sheet3Count + 1)) Or IsError(Sheets(3).Range("G" & sheet3Count + 2)) Or IsEmpty(Sheets(3).Range("G" & sheet3Count + 1)) Or IsEmpty(Sheets(3).Range("G" & sheet3Count + 2)) Or foundOverAll = True) Then Charts("Chart Q1").SeriesCollection(dataID).Values = 1 Charts("Chart Q1").SeriesCollection(dataID).XValues = -1 Charts("Chart Q1").SeriesCollection(dataID).MarkerSize = 2 Else Charts("Chart Q1").SeriesCollection(dataID).Values = Sheets(3).Range("G" & sheet3Count + 1) Charts("Chart Q1").SeriesCollection(dataID).XValues = Sheets(3).Range("G" & sheet3Count + 2) Charts("Chart Q1").SeriesCollection(dataID).MarkerSize = 18 End If If (Sheets(3).Range("B" & sheet3Count) = "Overall") Then Charts("Chart Q1").SeriesCollection(dataID).MarkerStyle = xlSquare Charts("Chart Q1").SeriesCollection(dataID).MarkerBackgroundColo rIndex = 1 foundOverAll = True Else Charts("Chart Q1").SeriesCollection(dataID).MarkerStyle = xlCircle Charts("Chart Q1").SeriesCollection(dataID).MarkerBackgroundColo rIndex = xlAutomatic End If dataID = dataID + 1 sheet3Count = sheet3Count + 4 Loop |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Drag datapoints in excel 2007 chart | Charts and Charting in Excel | |||
Changing Pivot Range Programatically - header row issue | Excel Programming | |||
Programatically changing picture in UserForm - VBA - Mac OSX | Excel Programming | |||
Changing Pivot Range Programatically | Excel Programming | |||
Changing what is displayed in an image control programatically | Excel Programming |