ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Want to cycle through PivotCharts and Charts continuasly (https://www.excelbanter.com/excel-programming/386131-want-cycle-through-pivotcharts-charts-continuasly.html)

Michael[_44_]

Want to cycle through PivotCharts and Charts continuasly
 
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




Michael[_44_]

Want to cycle through PivotCharts and Charts continuasly
 
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

"Michael" wrote in message
...
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







All times are GMT +1. The time now is 12:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com