+ Reply to Thread
Results 1 to 9 of 9

Conditional Hide Cell Rows

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    10-30-2006
    MS-Off Ver
    O365
    Posts
    311

    Conditional Hide Cell Rows

    Hi can anyone please help me?

    Cell C4 has a dropdown box with 4 options in the lis - All, Reports, Training and Meetings

    Range C6:C30 has 'All' information
    Range C6:C10 has 'Reports' information
    Range C11:C20 has 'Training' information
    Range C21:C30 has 'Meetings' information

    I would like a macro (or formula if possible) to hide rows based on the option that is selected in the dropdown. Or show the cell range based on the dropdown, whichever is easier!

    Many thanks in advance
    Jimmi
    Last edited by jimmisavage; 12-06-2013 at 04:20 AM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Conditional Hide Cell

    You can hide cell contents using Conditional Formatting. Set the font color to be the same as the background color, that renders it "invisible"
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    10-30-2006
    MS-Off Ver
    O365
    Posts
    311

    Re: Conditional Hide Cell

    Thanks FDibbins but I would then be left with blank cells on my worksheet. This is not really what I'm looking for

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,772

    Re: Conditional Hide Cell

    Then what do you mean by "hide cells"? You can hide rows, and you can hide columns, but you can't hide individual cells.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  5. #5
    Forum Contributor
    Join Date
    10-30-2006
    MS-Off Ver
    O365
    Posts
    311

    Re: Conditional Hide Cell

    You are correct - I mean hide the rows which contain the cells with the information in. I have edited my post so it makes sense now

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Conditional Hide Cell

    Maybe:

    Private Sub Worksheet_Change(ByVal Target As Range)
    Range("A1:A" & ActiveSheet.UsedRange.Rows.count).EntireRow.Hidden = False
    If Not Intersect(Target, Range("C4")) Is Nothing Then
        Select Case Target.Value
            Case Is = "All"
                Rows("6:30").Hidden = False
            Case Is = "Reports"
                Rows("11:30").Hidden = True
            Case Is = "Training"
                Rows("21:30").Hidden = True
                Rows("6:11").Hidden = True
            Case Is = "Meetings"
                Rows("6:20").Hidden = True
        End Select
    End If
    End Sub

  7. #7
    Forum Contributor
    Join Date
    10-30-2006
    MS-Off Ver
    O365
    Posts
    311

    Re: Conditional Hide Cell Rows

    Fantastic! Thanks a lot John H. Davis

  8. #8
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Conditional Hide Cell Rows

    You're welcome. Glad to help out and thanks for the feedback. Please compy with Post#8.

  9. #9
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,772

    Re: Conditional Hide Cell Rows

    If your question has been answered please mark your thread as "Solved" so that members will know that your problem is solved.

    Go to the menu immediately above your first post to the thread and click on Thread Tools. From the dropdown menu select "Mark this thread as solved..."

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. hide cell contents without column or row hide
    By ravergirl7216 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-30-2010, 11:20 AM
  2. looping thru a range to hide where cell = #N/A and conditional formatting
    By tinkerbelle in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-16-2010, 09:52 AM
  3. Replies: 3
    Last Post: 11-16-2007, 10:16 AM
  4. Check box and conditional hide
    By gdub in forum Excel General
    Replies: 4
    Last Post: 01-19-2007, 06:44 PM
  5. Hide cell value conditional on its value
    By pstar in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-04-2006, 02:30 PM

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