Hi everyone.
I need to select every 2nd row in filered table. For example, if visible rows are as in the table below, i need to select 5th, 10th and 19th. Thx for your help
<tbody>
</tbody>
I need to select every 2nd row in filered table. For example, if visible rows are as in the table below, i need to select 5th, 10th and 19th. Thx for your help
*Row number* | *Column A Header |
2 | |
5 | |
8 | |
10 | |
15 | |
19 | |
25 |
<tbody>
</tbody>
Code:
Sub Eeeeeee()Dim rng As Range
Dim InputRng As Range
Dim InputRngArea As Range
Dim OutRng As Range
Dim xInterval As Integer
Set InputRng = Range("C1:C200")
xInterval = 2
For i = 2 To InputRng.Rows.Count Step xInterval
Set rng = InputRng.Cells(i, 1)
If OutRng Is Nothing Then
Set OutRng = rng
Else
Set OutRng = Application.Union(OutRng, rng)
End If
Next
OutRng.EntireRow.Select
End Sub