Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Run time Error '1004: Method 'Cells' of object'_Global' failed


Hello,

I am trying to generate a chart with multiple series. The number o
series is not fixed and can be any number. I recorded a macro and the
modified the code. 'Counter' refers to the number of the series and
have referenced it in a worksheet. I am getting the error in the lin
that is bold. Thank you for your help.

The code is as follows:

Dim Counter As Integer
Dim i As Integer

Sheets("With TC").Select
Counter = Cells(38, 13).Value
ActiveChart.ChartType = xlLine
With Sheets("VP_WithTC")
ActiveChart.SetSourceData Source:=.Range(.Cells(2, 13)
.Cells(Counter, 16)), PlotBy _
:=xlRows
End With
For i = 2 To Counter
With ActiveChart.SeriesCollection.NewSeries

*.Values = ActiveSheet.Range(Cells(i, 13), Cells(i, 16))*
.XValues = ActiveSheet.Range("E1:H1")
End With

Next i

ActiveChart.Location Whe=xlLocationAsNewSheet
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "Value Path Graph"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text
"Criteria"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text
"Normalized values"
End With


End Su

--
Ajay_
-----------------------------------------------------------------------
Ajay_N's Profile: http://www.excelforum.com/member.php...fo&userid=3741
View this thread: http://www.excelforum.com/showthread.php?threadid=57097

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
Run-time error '1004': AutoFill method of Range class failed murkaboris Excel Discussion (Misc queries) 3 April 14th 09 10:35 PM
Dynamic chart generation: Run time Error '1004: Method 'Cells' of object'_Global' fai Ajay_N Charts and Charting in Excel 1 August 15th 06 03:54 AM
Run-time error '1004': Method 'Cells' of object _Global failed Fran D[_6_] Excel Programming 3 May 12th 06 04:44 PM
Run-time error '1004'; Method 'Export' of object'_Chart' failed Father Guido[_5_] Excel Programming 3 November 25th 05 02:30 PM


All times are GMT +1. The time now is 03:01 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"