• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Need a Code to Select the 10th Visible row of the filtered data

chand1230

New Member
Thanks in advance,

Need a Code to Select the 10th Visible row of the filtered data
 

Attachments

  • Data to select 10th Visble row.xlsb
    11.5 KB · Views: 2
Similar concept, using different property to loop.
Code:
Sub Demo()
Dim vRow As Range
Dim i As Long: i = 0
With Worksheets("Sheet1")
    For Each vRow In .AutoFilter.Range.SpecialCells(xlCellTypeVisible).Rows
        If i = 10 Then
            vRow.Select
            Exit Sub
        End If
        i = i + 1
    Next
    If i < 10 Then
        MsgBox "There is less than 10 visible rows in range"
    End If
End With
End Sub
 
Similar concept, using different property to loop.
Code:
Sub Demo()
Dim vRow As Range
Dim i As Long: i = 0
With Worksheets("Sheet1")
    For Each vRow In .AutoFilter.Range.SpecialCells(xlCellTypeVisible).Rows
        If i = 10 Then
            vRow.Select
            Exit Sub
        End If
        i = i + 1
    Next
    If i < 10 Then
        MsgBox "There is less than 10 visible rows in range"
    End If
End With
End Sub


Thanks a lot Chihiro

It works like a charm.
 
Back
Top