Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loop through Charts 1

Status
Not open for further replies.

Kflasph

Programmer
Apr 8, 2002
65
US
I have tried several HUNDRED times to do this but I can't figure out how !

I have created charts in an excel spreadsheets and want to go back after I have create them all and add some more information ( Rectangles with colors for my own created legends ).

How can I loop through each of my charts in my workbook?

I'm doing this using Visual Basic via VBA to write to Excel.

Thanks in advance !

KFlasph

 



Hi,

Charts & VBA faq707-4811
Code:
    Dim cht As Chart, sht As Worksheet, cho As ChartObject
    For Each cht In Charts
        MsgBox cht.Name
    Next
    For Each sht In Sheets
        For Each cho In sht.ChartObjects
            MsgBox cho.Chart.Name
        Next
    Next


Skip,

[glasses] [red][/red]
[tongue]
 
Many Many Thanks !

That did it !

A star so I didn't have to go through a hundred more times !

Kflasph
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top