Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run-Time Error 1004 on ActiveChart.SeriesCollection(1).Values =
Next Problem is I now get a Run-Time Error 1004 on
ActiveChart.SeriesCollection part of my program. I double checked the variable names and everything is consistant. It appears that I can not use a varible name in the .Values and .XValues statements. The error code explaination is not very helpful. My code is below. Again thanks for your help. Sub CreateNewSortRange() Dim TotalsRange As Range Dim TotalsCell As Range Dim CategoryRange As Range Dim CategoryCell As Range Dim StartTotalsAddress As String Dim EndTotalsAddress As String Dim StartCategoryAddress As String Dim EndCategoryAddress As String Set TotalsRange = Sheets("TestRange").Range("C5:C24") For Each TotalsCell In TotalsRange If TotalsCell.Value 0 And StartTotalsAddress = "" Then StartTotalsAddress = TotalsCell.Address StartCategoryAddress = TotalsCell.Offset(0, -1).Address End If If TotalsCell.Value = 0 Then EndTotalsAddress = TotalsCell.Offset(-1).Address EndCategoryAddress = TotalsCell.Offset(-1, -1).Address Exit For End If Next ActiveSheet.ChartObjects("TotalsChart").Activate ActiveChart.ChartArea.Select ActiveChart.SeriesCollection(1).XValues = "=TestRange! StartTotalsAddress:EndTotalsAddress" ActiveChart.SeriesCollection(1).Values = "=TestRange! StartCategoryAddress:EndCategoryAddress" End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
run time error 1004 general odbc error excel 2003 vba | Excel Programming | |||
ActiveChart.SeriesCollection(1).Points(3).Select ERROR | Excel Programming | |||
Obtaining the value of an ActiveChart.SeriesCollection(1).Points(2) | Excel Programming | |||
Runtime Error '1004' Method 'ActiveChart' of Object '_Global' failed | Excel Programming | |||
run-time error '1004': Application-defined or object-deifined error | Excel Programming |