+ Reply to Thread
Results 1 to 2 of 2

Hiding sheets in a workbook with VB

  1. #1
    Registered User
    Join Date
    03-31-2005
    Posts
    10

    Hiding sheets in a workbook with VB

    Hi,

    I am wondering if it is possible to automatically hide specific sheets in a workbook based on a variable entered on the first sheet?

    Thanks,
    Brad J.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Brad J.,

    This example uses Sheet1 as the worksheet name. Substitute the name of the worksheet you want to hide for Sheet1.

    Example of Hidding a Worksheet using a Variable:

    If Variable = Condition Then
    Worksheets("Sheet1").Visible = False
    End If


    To Prevent the User from Changing the Setting Use:

    If Variable = Condition Then
    Worksheets("Sheet1").Visible = xlVeryHidden
    End If

    The only way to make the worksheet visible again is thorugh code by setting Visible = True.

    Hope this answers your question,
    Leith Ross
    Last edited by Leith Ross; 03-31-2005 at 05:18 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1