+ Reply to Thread
Results 1 to 2 of 2

VBA to hide and unhide rows based on a cell value in the row

Hybrid View

Preacher63 VBA to hide and unhide rows... 06-03-2015, 04:06 PM
daffodil11 Re: VBA to hide and unhide... 06-03-2015, 04:13 PM
  1. #1
    Registered User
    Join Date
    01-29-2013
    Location
    Selem, IN
    MS-Off Ver
    Excel 2010
    Posts
    1

    VBA to hide and unhide rows based on a cell value in the row

    I am try to crate an active worksheet that changes as options change.
    If the the cell in column 6 RANGE (F3:F10) = "Hide" hide the entire row otherwise unhide the row.
    Attached Files Attached Files
    Last edited by Preacher63; 06-04-2015 at 08:23 AM.

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: VBA to hide and unhide rows based on a cell value in the row

    I'd use a worksheet_change event to auto trigger when that cell changes. Don't forget you need code upfront to unhide everything each time.

    Private Sub Worksheet_Change(ByVal Target As Range)
    Application.EnableEvents = False
    
    
    If Target.Address = "$K$1" Then
      With Range("F3:F10")
        .EntireRow.Hidden = False
      End With
    
        For Each rngCell In Range("F3:F10")
            If rngCell = "Hide" Then
                rngCell.EntireRow.Hidden = True
            End If
        Next
    End If
    Application.EnableEvents = True
    End Sub
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

+ 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. how To hide/unhide rows based on cell value
    By novice2430 in forum Excel Programming / VBA / Macros
    Replies: 27
    Last Post: 06-05-2013, 01:39 PM
  2. Hide/Unhide rows based on cell value in each row
    By Drewf2000 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-22-2013, 07:11 AM
  3. Hide/Unhide rows based on Cell Value
    By noelwri in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-28-2012, 04:25 PM
  4. Hide/Unhide Rows Based On Cell Value
    By ZooTV92 in forum Excel General
    Replies: 5
    Last Post: 09-05-2011, 07:51 AM
  5. Unhide / Hide Rows Based on Cell Value
    By bradaresnick in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 03-02-2010, 10:02 AM

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