Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.charting
|
|||
|
|||
![]()
I wrote this on my machine running Win XP and XL2002. It worked. I gave it
to a friend running Win2000 and XL2000, and it fails on the code to delete the initial series. What else can we do? Ed Sub MakeNewScatterChart() Dim wkb As Workbook Dim wks As Worksheet Dim LastRow As Long Dim LastCol As Long Dim colData As Long Dim cht As Chart Dim chtObj As ChartObject Dim rngData As Range Dim rngXval As Range Dim rngSer As Range Dim strTitle As String ' Get limits of data Set wkb = ActiveWorkbook Set wks = wkb.Sheets(1) LastRow = wks.Range("A65536").End(xlUp).Row LastCol = wks.Range("IV4").End(xlToLeft).Column ' Set data range Set rngData = wks.Range(Cells(4, 1), Cells(LastRow, LastCol)) ' Define X data range Set rngXval = rngData.Columns(1) For colData = 2 To LastCol ' Add new chart object Set cht = wkb.Charts.Add With cht .ChartType = xlXYScatterSmoothNoMarkers ''' *** ERROR HERE *** ' Delete initial data series Do While .SeriesCollection.Count 0 .SeriesCollection(1).Delete Loop |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
2 Questions | New Users to Excel | |||
delete some cell formulas and leave others using code | Excel Worksheet Functions | |||
Delete Code Modules Programatically | Excel Discussion (Misc queries) | |||
Code to delete rows and column cells that have formulas in. | Excel Worksheet Functions | |||
Stubborn toolbars in Excel | Excel Discussion (Misc queries) |