Make charts Very Hidden

GeorgeB

Board Regular
Joined
Feb 16, 2002
Messages
239
Good Morning All
I have a loop that hides all sheets on closing but will not hide the charts. How do I do this?? Code as follows:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim a&
With Workbooks("Credit Card Recap 1.5")
'Loop through the worksheets
For a& = .Worksheets.Count To 2 Step -1
'Hide all but the first worksheet
.Worksheets(a&).Visible = xlSheetVeryHidden
Next a&
End With
'Application.ActiveWorkbook.Save
End Sub

Have a great day.
George
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Hi George

Try:

Dim isht As Integer

With Workbooks("Credit Card Recap 1.5")
'Loop through the sheets


For isht = ActiveWorkbook.Sheets.Count To 2 Step -1
'Hide all but the first worksheet
.Sheets(isht).Visible = xlSheetVeryHidden
Next sht

End with
_________________
Kind Regards
Dave Hawley
OzGrid Business Applications
Microsoft Excel/VBA Training
If it's Excel, then it's us!
This message was edited by Dave Hawley on 2002-03-11 08:05
 
Upvote 0

Forum statistics

Threads
1,214,590
Messages
6,120,423
Members
448,961
Latest member
nzskater

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top