+ Reply to Thread
Results 1 to 2 of 2

Hiding and unhiding rows

Hybrid View

  1. #1
    Registered User
    Join Date
    02-16-2009
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    78

    Hiding and unhiding rows

    Hi,

    I am hiding some rows of a range on click of some event.

    Now , after this operation I need to find the first unhidden row in the range.

    How can that be done?

    Thanks

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Hiding and unhiding rows

    Try this:
    Sub test()
        MsgBox FirstVisRow(Range("A5:B10")) ' hide some rows as you wish
    End Sub
    
    Function FirstVisRow(r As Range) As Long
        Dim rFind As Range
        
        On Error Resume Next
        Set rFind = r.Columns(1).SpecialCells(xlCellTypeVisible)
        If Not rFind Is Nothing Then FirstVisRow = rFind.Row
    End Function
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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