Cycle through pivotcharts

M

Michael

Helo everyone,

I have 2 pivotcharts. I want to write some sample code that cycles through
the 2 pivotcharts. Any ideas? My sample code doesn't work


For Each wsChart In Charts

Select Case wsChart.Name

Case "CTDefectsByDateChart"
wsChart("CTDefectsByDateChart").Visible = True
wsChart("AgingDefectsChart").Visible = False
Case "AgingDefectsChart"
wsChart("CTDefectsByDateChart").Visible = False
wsChart("AgingDefectsChart").Visible = True
End Select

Next wsChart



Thanks
Michael
 
G

Gary Brown

Off the top of my head, I would think that first you need to declare wsChart
Dim wsChart as chart
and 2nd use...
wsChart.Visible = True
instead of..
wsChart("CTDefectsByDateChart").Visible = True
Untested....
but hope this helps.
 

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

Top