View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
baconcow baconcow is offline
external usenet poster
 
Posts: 45
Default .Values / .XValues modification

Using the code and idea I found GOOGLE'ing another forum, I ended up getting
it to work. It seems I was missing the worksheet object at the beginning of
each inner range object.

Source: http://bytes.com/forum/thread15008.html


Dim WS As Worksheet
Dim end_21 As Long
Set WS = Worksheets("2.1 - Surface")
end_21 = WS.Range("M1").Value

' setup the chart labels, graph types, and series
With ch211.SeriesCollection(1)
.Name = "Actual"
.Values = WS.Range(WS.Range("E5"), WS.Range("E5").Offset(end_21))
.XValues = WS.Range(WS.Range("B5"), WS.Range("B5").Offset(end_21))
.ChartType = xlColumnClustered
.Border.Color = RGB(31, 73, 125) 'dark blue, text 2
.Interior.Color = RGB(31, 73, 125) 'dark blue, text 2
End With


Thanks again for your time and help, Jon.

Shawn