+ Reply to Thread
Results 1 to 3 of 3

Automaticall Hide Rows based on column value

Hybrid View

NotSwank Automaticall Hide Rows based... 11-12-2014, 03:05 PM
JOHN H. DAVIS Re: Automaticall Hide Rows... 11-12-2014, 04:02 PM
NotSwank Re: Automaticall Hide Rows... 11-12-2014, 04:26 PM
  1. #1
    Registered User
    Join Date
    02-15-2014
    Location
    Michigan
    MS-Off Ver
    O365
    Posts
    76

    Automaticall Hide Rows based on column value

    I want to have a VBA Code that automatically updates when a value in C1:C2088 changes. It should only care about cells with "hide" in them. These cells do have formulas in them that display either hide or "".

    What I have currently that isn't working is:

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
     Dim cell As Range
        
        For Each cell In Worksheets("NAV Import").Range("C1:C2088")
            If cell.Value = "hide" Then
                 cell.EntireRow.Hidden = True
            Else
                cell.EntireRow.Hidden = False
            End If
            Next cell
    End Sub

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

    Re: Automaticall Hide Rows based on column value

    I think you need a Change Event instead of SelectionChange? Is Sheet "NAV Import" the activesheet? Or is it a separate sheet?

  3. #3
    Registered User
    Join Date
    02-15-2014
    Location
    Michigan
    MS-Off Ver
    O365
    Posts
    76

    Re: Automaticall Hide Rows based on column value

    It's not necessarily the active sheet. Most of the work is being done on another sheet, which triggers changes on this sheet.

+ 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. [SOLVED] VBA macro that hide and unhide column to respective rows based on first column value
    By janine6192 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-14-2013, 06:21 PM
  2. Hide rows based on multiple column values
    By dtanios in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-07-2012, 02:09 PM
  3. auto hide of rows based on column info
    By petelomax in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-27-2012, 07:43 AM
  4. Hide rows based on value in one column
    By jlspartz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-09-2010, 03:31 PM
  5. [SOLVED] chk box to filter or hide rows based on value in a column
    By deanop in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-06-2005, 11:06 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