View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default Visual Basic Chart Objects array

When you are dealing with objects such as charts you are better off witha
collection than an array... Try something like this...

Sub test()
Dim colCharts As Collection
Dim cht As ChartObject

Set colCharts = New Collection

colCharts.Add Sheet1.ChartObjects(1), "Chart1"
colCharts.Add Sheet2.ChartObjects(1), "Chart2"

For Each cht In colCharts
MsgBox cht.Name
Next cht
End Sub

--
HTH...

Jim Thomlinson


"CloudDoctor" wrote:

Can anyone tell me how to set an array of charts within Visual Basic?

Thanks