+ Reply to Thread
Results 1 to 7 of 7

How can I Hide Sheet 2 from a Value in sheet 1

  1. #1
    Registered User
    Join Date
    04-08-2005
    Location
    Washington, DC
    Posts
    63

    How can I Hide Sheet 2 from a Value in sheet 1

    I have three sheets sheet 1 is where user inputs info
    sheets 2 and 3 are results
    I need to only display one or the other sheet depending on the
    value of a cell from sheet 1

  2. #2
    Registered User
    Join Date
    09-16-2004
    Location
    Virginia
    Posts
    46
    How familiar are you with VBA? You would need an event handler to capture the value entered, then show/hide the appropriate sheets. Something like:

    Please Login or Register  to view this content.
    This uses the Worksheet_Change event handler - this should be in the worksheet module.

    Hope this helps!
    Tom Stock
    Office version: MSO 2002 SP3
    OS: Windows XP Pro
    Hardware: IBM Thinkpad T41

  3. #3
    Registered User
    Join Date
    04-08-2005
    Location
    Washington, DC
    Posts
    63
    Some what new at VB,

  4. #4
    Registered User
    Join Date
    09-16-2004
    Location
    Virginia
    Posts
    46
    Quote Originally Posted by swieduwi
    Some what new at VB,
    I will annotate my code a little better:
    Please Login or Register  to view this content.
    To put the code in the worksheet module, hit Alt-F11 to get into the VB Editor. On the left-hand side, right-click on the worksheet you are checking, and click "View Code". Cut and paste the above code sample into the module. Change x and y in the a=ActiveSheet.Cells(x,y).Value statement to reflect the actual cell you are checking against. Also change the Sheet names to reflect the sheets that you want to show (Visible = true) and hide (Visible = false).

    I hope this clarifies everything.

  5. #5
    Registered User
    Join Date
    04-08-2005
    Location
    Washington, DC
    Posts
    63
    I tried it and could not get it to work.....

    I then tried this and it works but it's ugly and not very smooth



    Please Login or Register  to view this content.
    Last edited by swieduwi; 04-25-2005 at 02:47 PM.

  6. #6
    Registered User
    Join Date
    09-16-2004
    Location
    Virginia
    Posts
    46
    Why is it not smooth? Looks OK to me. You can add Appliction.Screenupdating = False to the beginning to make the screen changes invisible until their done.

    If it works, use it.. BTW, I left something out of my original code.

    My (revised) code equivalent to yours:

    Please Login or Register  to view this content.
    If you noticed, your case "x" and case "s" were exactly the same...

    HTH
    Last edited by tkstock; 04-25-2005 at 03:02 PM.

  7. #7
    Registered User
    Join Date
    04-08-2005
    Location
    Washington, DC
    Posts
    63
    Yea, Yours just Looks so much more Professional

    Mine looks amature ( oh wait I am )


    If you noticed, your case "x" and case "s" were exactly the same...
    Yea, there will be another diagram for X just not finished with it yet.
    Last edited by swieduwi; 04-25-2005 at 03: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