• Hide all toolbar and some sheets… (EXCEL97)

    Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Hide all toolbar and some sheets… (EXCEL97)

    Author
    Topic
    #357974

    Hello guys,

    1. I like to hide all toolbars includes header column,horizantal and vertical scroll bar
    and sheets tab

    2. I’m also want to start my wb always on the same sheet..let say I have
    5 sheets..A,B,C, D, E .I always want my wb to be open at sheet C

    3. I’m also want to hide some of my sheets..lets say I want to hide
    sheet D and E..many of the code that i saw gives an error when people
    hide some of their sheets

    What is the code to perform all this task on open the wb..like sub auto_open routine..

    many thanks

    Viewing 0 reply threads
    Author
    Replies
    • #532949

      You probably just want to do something like this:

      Sub Auto_Open()
          Application.DisplayFullScreen = True
          Application.CommandBars("Full Screen").Visible = False
          Sheets("Sheet2").Visible = False
      End Sub
      

      Just change Sheet2 to whichever one you want to hide. You can record other macros to hide more things and then add the code to the above. HTH –Sam

      • #532953

        Sub Full()
        Application.ScreenUpdating = False
        Application.CommandBars(“Standard”).Visible = False
        Application.CommandBars(“Formatting”).Visible = False
        Application.CommandBars(“Drawing”).Visible = False
        Application.DisplayFormulaBar = False
        Application.DisplayStatusBar = False

        Dim NumSheets
        NumSheets = Sheets.Count
        Dim i
        For i = 1 To NumSheets
        Sheets(i).Select
        With ActiveWindow
        .DisplayGridlines = False
        .DisplayHeadings = False
        .DisplayWorkbookTabs = False
        .DisplayHorizontalScrollBar = False
        .DisplayVerticalScrollBar = False
        End With
        Next i
        Sheets(1).Select
        End Sub

        Thanks but its not what I aim for..
        above code works fine until I decided
        to hide some of my sheets..it will
        return error and the code will not run..
        Anybody know how can I use above code
        and still can hide some of my sheets
        that I prefered and I can chose which
        sheet should always be open on the opening..many thanks
        should

        • #532976

          This is what I would do:

          Sub Full()
              Application.ScreenUpdating = False
              Application.CommandBars("Standard").Visible = False
              Application.CommandBars("Formatting").Visible = False
              Application.CommandBars("Drawing").Visible = False
              Application.DisplayFormulaBar = False
              Application.DisplayStatusBar = False
          
          Dim oSheet As Worksheet
              For Each oSheet In Worksheets
                  If oSheet.Visible Then
                      oSheet.Select
                      With ActiveWindow
                          .DisplayGridlines = False
                          .DisplayHeadings = False
                          .DisplayWorkbookTabs = False
                          .DisplayHorizontalScrollBar = False
                          .DisplayVerticalScrollBar = False
                      End With
                  End If
              Next oSheet
              Sheets(1).Select
              Application.ScreenUpdating = True
          End Sub
          

          This code will not hide all commandbars. If the user has other toolbars than the ones listed, they will not be hidden. If you need to hide all toolbars, then you will need to put in a For loop for CommandBars like the one I put in for worksheets.

          If you want that to happen automatically when you open the workbook, then that code would have to be put into the Workbook Open event procedure in the module behind the ThisWorkbook object.

          • #532990

            Thanks Mr.Coleman..maybe this is what i’m looking for..so far so good..regards

    Viewing 0 reply threads
    Reply To: Hide all toolbar and some sheets… (EXCEL97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: