Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I can't figure it out, This ran with no problem in my test sheet, but now it gets this error on the ActiveChart.SeriesCollection(1).XValues = _ "=Team Financial Tables!" & StartCategoryAddress & ":" & EndCategoryAddress line. I've triple checked the entire ChartObject section and the named areas referenced and they seem to be good. The error help is NO HELP. I have confirned that the variables have the correct values, but that is where I get stuck. Can someone point me in a good direction? The entire code is below. Thanks Jamie Sub ResizeChart_Revenue_By_Cust() 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 Sheets("Team Financial Tables").Activate Set TotalsRange = Sheets("Team Financial Tables").Range ("Revenue_By_Customer") For Each TotalsCell In TotalsRange If TotalsCell.Value 0 And StartTotalsAddress = "" Then StartTotalsAddress = TotalsCell.Address (ReferenceStyle:=xlR1C1) StartCategoryAddress = TotalsCell.Offset(0, -1).Address (ReferenceStyle:=xlR1C1) End If If TotalsCell.Value = 0 Then EndTotalsAddress = TotalsCell.Offset(-1).Address (ReferenceStyle:=xlR1C1) EndCategoryAddress = TotalsCell.Offset(-1, -1).Address (ReferenceStyle:=xlR1C1) Exit For End If Next Sheets("Financial Dashboard").Activate ActiveSheet.ChartObjects("Chart_Revenue_By_Cust"). Activate ActiveChart.SeriesCollection(1).DataLabels.Select ActiveChart.ChartArea.Select ActiveChart.SeriesCollection(1).XValues = _ "=Team Financial Tables!" & StartCategoryAddress & ":" & EndCategoryAddress ActiveChart.SeriesCollection(1).Values = _ "=Team Financial Tables!" & StartTotalsAddress & ":" & EndTotalsAddress End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Run Time Error 1004 Application-defined or object-defined error forsimple loop? Need help with what's wrong? | Excel Programming | |||
Export a chart in a GIF file. Run-time error '1004': Application-defined or object-defined error; | Excel Programming | |||
Run Time Error 1004: Application or Object Defined Error | Excel Programming | |||
Run Time 1004 Error: Application or Object Difine Error | Excel Programming | |||
run-time error '1004': Application-defined or object-deifined error | Excel Programming |