Thread: I hate lunch
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ben H Ben H is offline
external usenet poster
 
Posts: 18
Default I hate lunch

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.