Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Troubles with asigning x values and values to a chart

The following code returns run-time error 1004 with message:
Method'SeriesCollection' of object '_Chart' failed. It stops on:
ActiveChart.SeriesCollection(k).XValues = rngX

I tried already many ways of building this, but it stil doesn't work.
The code inside pharentesis: Range( .. ) returns proper value
"A7:A2407" (which are not empty) and PreformName(i) returns proper
value.

The motivation for this code is analysing mesurement data, which is set
in A and B colmun. In EmptyIndex there are positions of empty spaces
between mesurements.

Help me please

For k = 1 To (UBound(EmptyIndex) - 1)
rngX = Worksheets(PreformName(i)).Range("A" &
(EmptyIndex(k) + 3) & ":A" & EmptyIndex(k + 1))
rngVal = Worksheets(PreformName(i)).Range("B" &
(EmptyIndex(k) + 3) & ":B" & EmptyIndex(k + 1))
rngName = Worksheets(PreformName(i)).Range("A5")

ActiveChart.SeriesCollection(k).XValues = rngX
ActiveChart.SeriesCollection(k).Values = rngVal
ActiveChart.SeriesCollection(k).Name = rngName
With ActiveChart.SeriesCollection(k).Border
.ColorIndex = ColorInd
.Weight = xlMedium
.LineStyle = xlContinuous
End With
With ActiveChart.SeriesCollection(k)
.MarkerBackgroundColorIndex = xlNone
.MarkerForegroundColorIndex = xlNone
.MarkerStyle = xlNone
.Smooth = True
.MarkerSize = 3
.Shadow = False
End With
ColorInd = ColorInd + 1
Next k

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
Zero values in a log chart Joelle_Smith Charts and Charting in Excel 2 May 8th 23 03:42 AM
Sorting values in a bar chart Eric D Charts and Charting in Excel 4 April 17th 06 04:44 PM
Lines on chart don't correlate to values being charted BW Charts and Charting in Excel 1 April 13th 06 07:53 PM
How to chart a single column of values similar to a GROUP BY Paddy Charts and Charting in Excel 3 December 2nd 05 04:29 AM
Fan charts Dean Charts and Charting in Excel 7 May 30th 05 11:51 AM


All times are GMT +1. The time now is 10:34 AM.

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"