Home |
Search |
Today's Posts |
#1
|
|||
|
|||
variable code??
Would appreciate help with what I am doing wrong.. vba
does not like the lines containing the variables for setting chart parameters: Sub last1500() Dim currentrow As Integer Dim beginrow As Integer currentrow = Worksheets("data").Range("aa1").Value beginrow = currentrow - 1500 Application.ScreenUpdating = False ActiveSheet.ChartObjects("Chart 10").Activate ActiveChart.SeriesCollection(1).Values = "=DATA! RbeginrowC5:RcurrentrowC5" ActiveChart.SeriesCollection(2).Values = "=DATA! RbeginrowC19:RcurrentrowC19" End Sub |
#2
|
|||
|
|||
Paul
untested but try something like: ActiveChart.SeriesCollection(1).Values = _ "=DATA!R" & _ beginrow & _ "C5:R" & _ currentrow & _ "C5" ActiveChart.SeriesCollection(2).Values = _ "=DATA!R" & _ beginrow & _ "C19:R" & _ currentrow & _ "C19" Regards Trevor "Paul" wrote in message ... Would appreciate help with what I am doing wrong.. vba does not like the lines containing the variables for setting chart parameters: Sub last1500() Dim currentrow As Integer Dim beginrow As Integer currentrow = Worksheets("data").Range("aa1").Value beginrow = currentrow - 1500 Application.ScreenUpdating = False ActiveSheet.ChartObjects("Chart 10").Activate ActiveChart.SeriesCollection(1).Values = "=DATA! RbeginrowC5:RcurrentrowC5" ActiveChart.SeriesCollection(2).Values = "=DATA! RbeginrowC19:RcurrentrowC19" End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Make Change Case in Excel a format rather than formula | Excel Worksheet Functions | |||
Error trapped only while stepping through the code - Not triggered when run | Excel Discussion (Misc queries) | |||
Opening a file with code without a set file name | Excel Discussion (Misc queries) | |||
Opening a file with code without a set file name | Excel Discussion (Misc queries) | |||
Select sheet with VB code | Excel Discussion (Misc queries) |