Consulting

Results 1 to 6 of 6

Thread: Unhide Rows

  1. #1

    Unhide Rows

    I have a worksheet that has rows 32 through 37 hidden. It has two rows available to enter data: 30 and 31. I would like once the user enters data into row 30, for the next hidden row to unhide. Thus always showing two rows without data. If the data is deleted, the row would then rehide itself.

    Thanks.

    Edward

  2. #2
    VBAX Contributor compariniaa's Avatar
    Joined
    Jun 2006
    Location
    Santa Clarita, CA
    Posts
    117
    Location
    could you post a sample file so we i could get a little better idea? are rows 1-29 always going to have data in them?

  3. #3
    Rows 1 - 29 may not always have data in them, but they can always remain visible. I've also attached a sample file.

    Thanks in advance.

    edward

  4. #4
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Hi Edward,
    Welcome to VBAX
    Might need a little fine tuning, but I think something like this
    Regards
    MD
    [VBA]
    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Row < 29 Or Target.Row > 37 Then Exit Sub
    If Application.WorksheetFunction.CountA(Target.EntireRow) = 0 Then
    Target.RowHeight = 0
    Else
    Target.Offset(2).RowHeight = 12.5
    End If
    End Sub

    [/VBA]
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  5. #5
    Worked like a charm. Thanks a million!

    edward

  6. #6
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Glad to help.
    When your question has been answered, mark it solved by using the Thread Tools.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •