Results 1 to 11 of 11

Hiding a row, based on cell value.

Threaded View

Victor-J Hiding a row, based on cell... 08-15-2017, 05:05 AM
Sintek Re: Hiding a row, based on... 08-15-2017, 05:14 AM
Victor-J Re: Hiding a row, based on... 08-15-2017, 05:19 AM
Sintek Re: Hiding a row, based on... 08-15-2017, 05:21 AM
AlphaFrog Re: Hiding a row, based on... 08-15-2017, 05:20 AM
jindon Re: Hiding a row, based on... 08-15-2017, 05:21 AM
Victor-J Re: Hiding a row, based on... 08-15-2017, 05:24 AM
Victor-J Re: Hiding a row, based on... 08-15-2017, 05:30 AM
Sintek Re: Hiding a row, based on... 08-15-2017, 05:34 AM
jindon Re: Hiding a row, based on... 08-15-2017, 05:46 AM
Victor-J Re: Hiding a row, based on... 08-15-2017, 05:48 AM
  1. #1
    Registered User
    Join Date
    07-26-2017
    Location
    The Netherlands
    MS-Off Ver
    2010
    Posts
    20

    Hiding a row, based on cell value.

    I'm having the following issue. I have a matrix, in which I would like to hide rows, based on the values in cells in those rows. I've made a small example in Excel, which I uploaded here.

    The rows containing a Y I would like to keep, where I would like to hide the rows not containing a Y.
    I only got it to work using this formula:

    Formula: copy to clipboard
    Private Sub Hide_Rows()
    Range("C2:K7").EntireRow.Hidden = True
    Dim c As Range

    For Each c In Range("C2:K7").Cells
    If c.Value = "Y" Then
    c.EntireRow.Hidden = False

    End If
    Next c

    End Sub


    The problem with this formula is, that after executing it, it ends with an error at this line:
    " If c.Value = "Y" Then"

    Note: This is a test file, for some reason it does not give the error in this file. The other file I cannot upload due to being a company file.

    Anyone has a clue, or maybe a better way to hide the rows without the Y value?
    Attached Files Attached Files
    Last edited by Victor-J; 08-15-2017 at 05:08 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Hiding Rows Based on a Cell Value
    By smartcard in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-16-2015, 07:13 AM
  2. Hiding Sheets based on cell value, only hiding last sheet
    By mattblack2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-17-2014, 03:21 PM
  3. Un-Hiding and Hiding Columns based on Drop-Down Values in a Column.
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 10-30-2011, 09:24 AM
  4. Hiding rows based on value in another cell
    By sahar in forum Excel General
    Replies: 0
    Last Post: 10-12-2011, 10:27 AM
  5. Un-Hiding and Hiding Columns based on Drop-Down Values in a Column.
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-11-2011, 06:49 AM
  6. Hiding Rows Based based upon cell value being blank
    By leelee23 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-11-2007, 04:48 AM
  7. Hiding Row based on cell value
    By mohd21uk via OfficeKB.com in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-10-2006, 03:53 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