Results 1 to 4 of 4

[SOLVED]Hide Rows and Columns Based on User Input

Threaded View

  1. #1
    Registered User
    Join Date
    01-25-2013
    Location
    Vermont, Dakota
    MS-Off Ver
    Excel 2007
    Posts
    22

    Cool [SOLVED]Hide Rows and Columns Based on User Input

    Hi all,

    I'm running into an issue in trying to hide rows based on the input in one cell and hide columns based on the input in the other. Thus far I have only managed to make hiding the rows work as I intended. The code for that is below. How can I also hide columns K:S if "G15" = 1, L:S if "G15" = 2, ... S:S if "G15" = 9? Sorry if this wasn't the most clear.


    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target <> Range("G16") Then Exit Sub
    Sheets("Sheet1").Rows.Hidden = False
    Select Case Range("G16").Value
        Case 1
    
            Sheets("Sheet1").Rows("24:64").Hidden = True
        
        Case 2
        
            Sheets("Sheet1").Rows("29:64").Hidden = True
            
        Case 3
        
            Sheets("Sheet1").Rows("34:64").Hidden = True
                
        Case 4
        
            Sheets("Sheet1").Rows("39:64").Hidden = True
            
        Case 5
        
            Sheets("Sheet1").Rows("44:64").Hidden = True
            
        Case 6
        
            Sheets("Sheet1").Rows("49:64").Hidden = True
            
        Case 7
        
            Sheets("Sheet1").Rows("54:64").Hidden = True
            
        Case 8
        
            Sheets("Sheet1").Rows("59:64").Hidden = True
            
        Case 9
        
            Sheets("Sheet1").Rows("64:64").Hidden = True
            
    End Select
    End Sub
    Last edited by thesteve; 02-04-2013 at 11:07 AM. Reason: solved

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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