Want to cycle through PivotCharts and Charts continuasly

M

Michael

I have a worksheet with 2 PivotCharts (in separate worksheets) and two other
charts (again in 2 separate worksheets). I want to write some sample VBA
code that runs all the time and simply cycles through these 4 worksheets.
Anyone with some sample code?

Thanks
Michael
 
M

Michael

The solution is

Sub ToogleSheetVisiblity()
Dim wsSheet As Worksheet
On Error Resume Next 'If code tries to hide all Sheets
For Each wsSheet In Worksheets
wsSheet.Visible = Not wsSheet.Visible
Next wsSheet
On Error GoTo 0 'One sheet will always be left visible
End Sub
 

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