Thread: Chart syntax
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Chart syntax

Sub arrayLoop()
Dim obj As Object
Dim myChart As Excel.Chart
For Each obj In ActiveSheet.ChartObjects
If obj.Name = "Chart 1" Then
Set myChart = obj.Chart
MsgBox myChart.Name
End If
Next
End Sub

-or-

Sub arrayLoop2()
Dim myChart As Excel.Chart
Set myChart = ActiveSheet.ChartObjects(1).Chart
MsgBox myChart.Name
End Sub

--
Jim Cone
San Francisco, USA
http://www.officeletter.com/blink/specialsort.html




"Arne Hegefors"

wrote in message
Hello! Itried that but there is no such thing as obj.Chart in VBA. Thank you
very much anyway! If you have any other idea how to get this to work please
help me out! Thanks alot!
"Jim Cone" skrev:
I would try...
Set myChart = obj.Chart
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware