Prevent Others From Displaying Hidden Tabs

  • I hide the sheet tabs of my file...
    and don't want anyone to display it by enabling the Sheet tabs in the Tools-Options-View menu


    I'm having this code ThisWorkbook but it's not working...
    some help pls....


    Thanks a mil.



    Sub HideTabs()
    If ActiveWindow.DisplayWorkbookTabs = True Then
    ActiveWindow.DisplayWorkbookTabs = False
    End If
    End Sub

  • There are a couple of solutions.


    First and the worst solution is to attempt to turn off the Tools ... Options menu and reassign the short cut keys. However, as many will tell you that is poor practice.



    The other and easiest method is to use the Workbook_SheetChange and Workbook_SheetActivate events and each time the events fire rehide the sheet tabs.


    However, as many will tell you that this is poor practice. I know my first app, which is still in use, does this and it stinks. Why don't you want the uesr to see the sheet tabs????



    Regards,
    Barry

  • Thanks Barry...


    Just want to keep my workbook look "clean", that's y m hiding the sheet tabs...(m also hiding column and row headers, actually).


    Can you give me the codes for the events Workbook_SheetChange and Workbook_SheetActivate to accomplish this...?


    And may I know what "problems" you are facing with this?


    Thanks again...


    God bless..!!!

  • Hi lorenzod,


    Private Sub Worksheet_Activate()
    With ActiveWindow
    .DisplayGridlines = False
    .DisplayWorkbookTabs = False
    End With


    End sub


    Copy this code and paste it into the code area for the sheet in question.


    Regards,


    Bill

  • First Hide the tabs first. If you are to use the vba codes. Otherwise, if the user use CTRL+ PageUP or PageDown, they could still browse different worksheet.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!