Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Jul 2001
    Location
    Kuala Lumpur , MALAYSIA
    Posts
    154
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hide all toolbar and some sheets... (EXCEL97)

    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

  2. #2
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Hide all toolbar and some sheets... (EXCEL97)

    You probably just want to do something like this:
    <pre>Sub Auto_Open()
    Application.DisplayFullScreen = True
    Application.CommandBars("Full Screen").Visible = False
    Sheets("Sheet2").Visible = False
    End Sub
    </pre>


    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
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  3. #3
    2 Star Lounger
    Join Date
    Jul 2001
    Location
    Kuala Lumpur , MALAYSIA
    Posts
    154
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hide all toolbar and some sheets... (EXCEL97)

    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

  4. #4
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hide all toolbar and some sheets... (EXCEL97)

    This is what I would do:

    <pre>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
    </pre>


    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.
    Legare Coleman

  5. #5
    2 Star Lounger
    Join Date
    Jul 2001
    Location
    Kuala Lumpur , MALAYSIA
    Posts
    154
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hide all toolbar and some sheets... (EXCEL97)

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

Posting Permissions

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