+ Reply to Thread
Results 1 to 4 of 4

automatically hide/ unhide a row based on information in a cell from row above? How?

  1. #1
    Registered User
    Join Date
    12-03-2011
    Location
    Walnut Cove, NC
    MS-Off Ver
    Office 365
    Posts
    98

    automatically hide/ unhide a row based on information in a cell from row above? How?

    OK,

    you guys were great in helping me with my IF/VLOOKUP functions, now I have something new! I have several empty rows in my spreadsheet (below each day). I only need for one row at a time to show up. My idea was to leave one row ready to input information, as information is inserted then the row below would unhide - when information is added to that row, then the row below it would unhide and so on. I looked at the autofilter function, I don't think it will work the way I want it to. Also, I don't want to have to click a button or anything to get this to work. I don't think the insert row will work, one I have a lot of auto-information applied & I also have additional sheets that are linked to data on this sheet, so changing row numbers wouldn't be good. I have attached a file for reference.

    Thanks

    Matt
    Attached Files Attached Files
    Last edited by MattHamby; 12-04-2011 at 10:17 PM.

  2. #2
    Registered User
    Join Date
    12-03-2011
    Location
    Walnut Cove, NC
    MS-Off Ver
    Office 365
    Posts
    98

    Re: automatically hide/ unhide a row based on information in a cell from row above? H

    I found this code on another forum

    Private Sub Worksheet_Change(ByVal Target As Range)

    If Target.Cells.Count > 1 Then Exit Sub

    If Not Intersect(Target, Range("A38:A" & Rows.Count)) Is Nothing Then
    If Target.Value = "" Then
    Rows(Target.Row + 1).Hidden = True
    Else
    Rows(Target.Row + 1).Hidden = False
    End If
    End If

    End Sub

    I am going to try this, and I will reply to if I get it to work
    Last edited by MattHamby; 12-04-2011 at 09:34 PM.

  3. #3
    Registered User
    Join Date
    12-03-2011
    Location
    Walnut Cove, NC
    MS-Off Ver
    Office 365
    Posts
    98

    Re: automatically hide/ unhide a row based on information in a cell from row above? H

    Well, I have had no luck with the code above, any help would be nice!

    Thanks,

    Matt

  4. #4
    Registered User
    Join Date
    12-03-2011
    Location
    Walnut Cove, NC
    MS-Off Ver
    Office 365
    Posts
    98

    Re: automatically hide/ unhide a row based on information in a cell from row above? H

    in the range I did change it from "A38:A" to "A4:A10" (A4:A10 is the first range set, there are going to be a total of 7 of these per sheet)

    Thanks

    Matt

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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