S
Sibilia
Hi all,
I have a chart with time period on axis. I want the user of this char
to be able to change this time period via a button.
here is the beginning of the macro link to the button. the macro bug
when I want the series to be defined depending on the calculated ro
numbers of the series (in bold in the macro).
The error message is "Method Cells of object '_global' failed"
Do anyone have a solution for this problem ?
Many thanks
Sibilia
Sub Axis_Graph()
Dim startYear As Integer
Dim EndYear As Integer
Dim startYear2 As Integer
Dim EndYear2 As Integer
Dim StartLine As Integer
Dim EndLine As Integer
startYear = 1950 ' default value
EndYear = 2050 ' default value
startYear2 = Sheets("Incidence").Range("H9").Value ' choose by th
user
EndYear2 = Sheets("Incidence").Range("J9").Value ' choose by the user
StartLine = 3 + (startYear2 - startYear) 'Calculte the row numbe
where is the StartYear2
EndLine = 103 - (EndYear2 - EndYear) 'Calculte the row number where i
the EndYear2
Sheets("Incidence").Activate
ActiveSheet.ChartObjects("Chart 32").Activate
*ActiveChart.SeriesCollection(1).XValues
ActiveSheet.Range(Cells(StartLine, "W"), Cells(EndLine, "W"))
'ActiveSheet.Range("W3:W103")*
....
I have a chart with time period on axis. I want the user of this char
to be able to change this time period via a button.
here is the beginning of the macro link to the button. the macro bug
when I want the series to be defined depending on the calculated ro
numbers of the series (in bold in the macro).
The error message is "Method Cells of object '_global' failed"
Do anyone have a solution for this problem ?
Many thanks
Sibilia
Sub Axis_Graph()
Dim startYear As Integer
Dim EndYear As Integer
Dim startYear2 As Integer
Dim EndYear2 As Integer
Dim StartLine As Integer
Dim EndLine As Integer
startYear = 1950 ' default value
EndYear = 2050 ' default value
startYear2 = Sheets("Incidence").Range("H9").Value ' choose by th
user
EndYear2 = Sheets("Incidence").Range("J9").Value ' choose by the user
StartLine = 3 + (startYear2 - startYear) 'Calculte the row numbe
where is the StartYear2
EndLine = 103 - (EndYear2 - EndYear) 'Calculte the row number where i
the EndYear2
Sheets("Incidence").Activate
ActiveSheet.ChartObjects("Chart 32").Activate
*ActiveChart.SeriesCollection(1).XValues
ActiveSheet.Range(Cells(StartLine, "W"), Cells(EndLine, "W"))
'ActiveSheet.Range("W3:W103")*
....