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.
--
Gary Brown
(E-Mail Removed)
If this post was helpful to you, please select ''YES'' at the bottom of the
post.
"Michael" wrote:
> 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
>
>
>