+ Reply to Thread
Results 1 to 4 of 4

Unhiding columns on multiple tabs dependent on selection of dropdown list in 1 tab

  1. #1
    Registered User
    Join Date
    11-17-2010
    Location
    Canberra, Australia
    MS-Off Ver
    Excel 2010
    Posts
    19

    Unhiding columns on multiple tabs dependent on selection of dropdown list in 1 tab

    Hi all,

    I have a worksheet with multiple tabs that I need to be able to unhide columns in depending on the selection of a dropdown list in the first tab. The dropdown list is in "F4" in sheet 1 labelled "Part 1". Depending on how many businesses the user is reporting for, they select that number from the dropdown and that subsequently unhides all the relevent rows on the following tabs labelled "Part 2", "Part 3" etc...

    I've managed to get the first bit of code working for Part 1 (below in the code tags), but now I want to extend this to the "Part 2". The following columns need to be unhidden/hidden in "Part 2" for the following selections in F4 of "Part 1":

    Case Is = "2"
    Columns("A:AW").EntireColumn.Hidden = False
    Columns("AX:FB").EntireColumn.Hidden = True
    Case Is = "3"
    Columns("A:BS").EntireColumn.Hidden = False
    Columns("BT:FB").EntireColumn.Hidden = True
    Case Is = "4"
    Columns("A:CO").EntireColumn.Hidden = False
    Columns("CP:FB").EntireColumn.Hidden = True
    Case Is = "5"
    Columns("A:DK").EntireColumn.Hidden = False
    Columns("DL:FB").EntireColumn.Hidden = True
    Case Is = "6"
    Columns("A:EG").EntireColumn.Hidden = False
    Columns("EH:FB").EntireColumn.Hidden = True
    Case Is = "7"
    Columns("A:"FA).EntireColumn.Hidden = False
    Columns("FB:FB").EntireColumn.Hidden = True

    Code for "Sheet 1"
    Please Login or Register  to view this content.
    Thanks for the help everyone
    Last edited by gazzz_tha1; 05-10-2011 at 08:41 PM. Reason: Problem not entirely solved as yet...

  2. #2
    Registered User
    Join Date
    11-17-2010
    Location
    Canberra, Australia
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Unhiding columns on multiple tabs dependent on selection of dropdown list in 1 ta

    Got it sorted:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-17-2010
    Location
    Canberra, Australia
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Unhiding columns on multiple tabs dependent on selection of dropdown list in 1 ta

    The code in my second post works fine on an unlocked sheet, but when I lock the sheet I get the following VBA error message when I try to select a new number from the dropdown list in F4 of "Part 1":

    "Run-time error '1004': Unable to set the Hidden property of the Range class"

    I've attached a sample spreadsheet to help out. Thanks alot everyone
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    11-17-2010
    Location
    Canberra, Australia
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Unhiding columns on multiple tabs dependent on selection of dropdown list in 1 ta

    Can/Will anyone help me with this??

+ 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