LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Error Creating Chart


Hey guys,

I am trying to create a chart of data based on the user's selection of
data. The code is below:


Code:
--------------------

Private Sub CommandButton1_Click()
Charts.Add
ActiveChart.ChartType = xlXYScatterLines
ActiveChart.SetSourceData Source:=Sheets("PFIR").range("A1:I3"), PlotBy:= _
xlRows
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).XValues = Worksheets("Data").range(Worksheets("Data").Cells( 6, 2), Worksheets("Data").Cells(lastrow, 2))
ActiveChart.SeriesCollection(1).Values = Worksheets(reactorone).range(lineonerow, lineonecolumn)
ActiveChart.SeriesCollection(2).XValues = xtime
ActiveChart.SeriesCollection(2).Values = linetwo
ActiveChart.SeriesCollection(3).XValues = xtime
ActiveChart.SeriesCollection(3).Values = linethree
ActiveChart.SeriesCollection(4).XValues = xtime
ActiveChart.SeriesCollection(4).Values = linefour
ActiveChart.Location Whe=xlLocationAsNewSheet
With ActiveChart
.HasTitle = False
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = False
End With
End Sub

--------------------


The line that spits back the error is:


Code:
--------------------

ActiveChart.SeriesCollection(1).XValues = Worksheets("Data").range(Worksheets("Data").Cells( 6, 2), Worksheets("Data").Cells(lastrow, 2))

--------------------


It gives me an error saying something about object or application
undefined. I don't understand why this would possibly kick back an
error, I have specifically referenced each cell and lastrow is an
integer value.

Does anyone have any ideas?

~Jason


--
jclark419
------------------------------------------------------------------------
jclark419's Profile: http://www.excelforum.com/member.php...o&userid=25430
View this thread: http://www.excelforum.com/showthread...hreadid=558543

 
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
Creating a mix of column and scatter chart on one chart. Matt G[_3_] Charts and Charting in Excel 1 June 17th 09 05:25 AM
Creating a chart(? pie chart) that shows customers,dates and machi Mark M Charts and Charting in Excel 1 August 20th 08 10:19 PM
Error when creating a stock chart from data in .CSV file Curious[_2_] Excel Discussion (Misc queries) 9 April 16th 08 02:20 AM
Creating Second Chart via Sub Procedure Error [email protected] Excel Programming 3 October 29th 05 01:42 PM
Creating Second Chart via Sub Procedure Error [email protected] Excel Programming 0 October 28th 05 08:59 AM


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

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

About Us

"It's about Microsoft Excel"