Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
N10 N10 is offline
external usenet poster
 
Posts: 141
Default I hate lunch

HI Ben

I got the following to work after including your Sheet name in quotes. :)


With Sheets("strDataName")
Set rng1 = .Range(.Cells(2, 4), _
.Cells(2, 4).End(xlDown))
Set rng2 = .Range(.Cells(2, 3), _
.Cells(2, 3).End(xlDown))

End With

Charts.Add
ActiveChart.ChartType = xlXYScatterSmooth
ActiveChart.Location Whe=xlLocationAsNewSheet
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Name = Sheets("strDataName").Cells(1, 4)
ActiveChart.SeriesCollection(1).XValues = rng1
ActiveChart.SeriesCollection(1).Values = rng2


Happy ploting :)

N10

"Ben H" wrote in message
...
This is a really interesting one. So I spent all morning working on this.
I
got it run perfectly about 20 times and then broke for lunch. I come back
and a gremlin is now maraudering in my code, laying seige to it. Its
hiding
in the all the SeriesCollection functions!

With Sheets(strDataName)
Set rng1 = .Range(.Cells(2, 4), _
.Cells(2, 4).End(xlDown))
Set rng2 = .Range(.Cells(2, 3), _
.Cells(2, 3).End(xlDown))

End With

Charts.Add
ActiveChart.ChartType = xlXYScatterSmooth
ActiveChart.Location Whe=xlLocationAsNewSheet, Name:=strChartName
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Name = Sheets(strDataName).Cells(1, 4)
ActiveChart.SeriesCollection(1).XValues = rng1
ActiveChart.SeriesCollection(1).Values = rng2

Any idea at all would cure this?

Ben H.



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
Hate DBL post but I really need help [email protected] Excel Worksheet Functions 0 October 21st 09 11:01 PM
I hate the DIV/0! error! Can anyone help me make this go away? Dan the Man[_2_] Excel Discussion (Misc queries) 5 August 26th 08 01:28 AM
How much I hate the ribbon ion Excel Discussion (Misc queries) 5 November 28th 07 02:23 PM
I hate paths! Ross[_2_] Excel Discussion (Misc queries) 2 April 4th 07 10:14 PM
i hate your formatting popus Format Popups Excel Discussion (Misc queries) 1 March 11th 06 01:25 AM


All times are GMT +1. The time now is 03:46 PM.

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"