Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Make charts Very Hidden

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Location
    Las Vegas Nevada USA
    Posts
    239
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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

  2. #2
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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 ]

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Location
    Las Vegas Nevada USA
    Posts
    239
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks Dave. That works well. Have a great day.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •