For each objcht in ...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to do the following:

For Each objCht In SheetCodeName
With objCht
Debug.Print .Chart.ChartTitle.Text
End With
Next objCht

I'm getting an error on the first line. For this example, I'm assuming the
code name is SheetCodeName. What am I doing wrong.

In addition, I want to parse the chart title with the split at "-", what do
I need to do. There should be only one entry of "-"

Thanks
 
I would use the ChartObjects collection instead

For each objChart in SheetCodeName.ChartObjects
With objCht

End With
Next objChart

and depending on what you need to do with the title, you can use the
Left$(), Right$(), Mid$() and InStr() functions.
 

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

Back
Top