+ Reply to Thread
Results 1 to 5 of 5

Unhide/Hide column when choosing dropdown list

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    03-10-2009
    Location
    Toronto
    MS-Off Ver
    Excel 2003, 2007
    Posts
    103

    Smile Unhide/Hide column when choosing dropdown list

    Hi,

    I'm not sure if this is possible or not but maybe someone can help.
    Is there a way to have a column unhide one choosing a certain value from a dropdown list (validation)?
    I want the column to be hidden throughout the worksheet until a specific value is chosen in the list. Once it's chosen then I want it to unhide that column.

    Any help would be appreciated.
    Thanks.
    Last edited by yuzi; 10-06-2009 at 12:45 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Unhide/Hide column when choosing dropdown list

    Can you post an example file that demonstrates your requirements ?

    You will need to use VBA to toggle column visibility.

  3. #3
    Forum Contributor
    Join Date
    03-10-2009
    Location
    Toronto
    MS-Off Ver
    Excel 2003, 2007
    Posts
    103

    Re: Unhide/Hide column when choosing dropdown list

    I've attached an example.
    I want column S (Transfers In Cost Centre) to be hidden until they choose Transfers within BMO in column R.
    Attached Files Attached Files

  4. #4
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Unhide/Hide column when choosing dropdown list

    In the worksheet module:
    Option Explicit
    
    Private Sub Worksheet_Activate()
    
    'hide column-S upon activating the sheet
    
        Columns("S").EntireColumn.Hidden = True
    End Sub
    
    Private Sub Worksheet_Change(ByVal Target As Range)
    
        Dim lrow As Long
        
        lrow = Cells(Rows.Count, 1).End(xlUp).Row
        
    'toggle column-S visibility
        
        If Not Intersect(Target, Range("R2:R" & lrow)) Is Nothing Then
            Columns("S:S").EntireColumn.Hidden = Target.Value <> "Transfer"
        End If
    
    End Sub
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  5. #5
    Forum Contributor
    Join Date
    03-10-2009
    Location
    Toronto
    MS-Off Ver
    Excel 2003, 2007
    Posts
    103

    Re: Unhide/Hide column when choosing dropdown list

    Thank you this worked.

+ 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