chart settings

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

VBA does not like my syntax on the variables in the last
two lines. Please tell me what I am doing wrong:

Sub ONEDAY()
Dim maxrow As Integer
Dim onedayopen As Integer

maxrow = Sheets("DATA").[AA1].Value

onedayopen = maxrow - 4000


ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(1).XValues = "=DATA!
RonedayopenC1:RmaxrowC1"
ActiveChart.SeriesCollection(1).Values = "=DATA!
RonedayopenC12:RmaxrowC12"

End Sub
 
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(1).XValues = _
"=DATA!R" & onedayopen & "C1:R" & maxrow & "C1"
ActiveChart.SeriesCollection(1).Values = _
"=DATA!R" & onedayopen & "C12:R" & maxrow & "C12"
 
thanks Tom

-----Original Message-----
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(1).XValues = _
"=DATA!R" & onedayopen & "C1:R" & maxrow & "C1"
ActiveChart.SeriesCollection(1).Values = _
"=DATA!R" & onedayopen & "C12:R" & maxrow & "C12"


--
Regards,
Tom Ogilvy

VBA does not like my syntax on the variables in the last
two lines. Please tell me what I am doing wrong:

Sub ONEDAY()
Dim maxrow As Integer
Dim onedayopen As Integer

maxrow = Sheets("DATA").[AA1].Value

onedayopen = maxrow - 4000


ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(1).XValues = "=DATA!
RonedayopenC1:RmaxrowC1"
ActiveChart.SeriesCollection(1).Values = "=DATA!
RonedayopenC12:RmaxrowC12"

End Sub


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top