Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
ams ams is offline
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Drag datapoints in excel 2007 chart Mister Blobby 6058 Charts and Charting in Excel 1 September 20th 07 04:17 AM
Changing Pivot Range Programatically - header row issue Scott Lyon[_2_] Excel Programming 3 July 22nd 04 04:29 AM
Programatically changing picture in UserForm - VBA - Mac OSX dirk Excel Programming 2 May 14th 04 12:40 PM
Changing Pivot Range Programatically Reney Langlois Excel Programming 1 May 14th 04 03:10 AM
Changing what is displayed in an image control programatically Eric Kehr Excel Programming 2 April 27th 04 08:16 AM


All times are GMT +1. The time now is 12:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"