Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am not sure what WS.Cells(12, i).Value equates to, nor what the variable
query equates to, but I do know the if you use Range(anyVariable) then anyVariable has to equate to a range address, e.g. "A1:B4" or something similar. If you are trying to use it with the variable "query" equating to an integer or set of integers, it won't work. "royend" wrote: Hi. I am trying to control my graph programmatically and it seems I need to use a Range somehow. My code so far: ----- Sub UpdateReport() Dim query As String Dim WS As Worksheet Set WS = Worksheets("Oppsummering - kroner") End = 2 * [B2] Period = 2 * [B3] For i = End - Period To End If (i = End - Period) Then 'first cell added to range query = WS.Cells(12, i).Value Else query = query & "," & WS.Cells(12, i).Value End If Next i ActiveSheet.ChartObjects("Diagram 3").Activate ActiveChart.SeriesCollection(1).XValues = _ Range(query) ActiveChart.SeriesCollection(1).Values = _ Range(query) End Sub ----- Why doesn't it work? The range consist of values seperated by ",". e.g: "120, 100, 80, 100" Looking forward to your help... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Cannot Update Chart Data Range! | Excel Discussion (Misc queries) | |||
trying to programmatically change chart data range with vb.net | Charts and Charting in Excel | |||
Update Chart data Range with VBA | Charts and Charting in Excel | |||
Update Chart data Range with VBA | Excel Programming | |||
Dynamic Chart Range and Chart Update | Excel Programming |