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
[TABLE="class: grid, width: 100"]
<tbody>[TR]
[TD]*Row number*[/TD]
[TD]*Column A Header[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]19[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]25[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
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
[TABLE="class: grid, width: 100"]
<tbody>[TR]
[TD]*Row number*[/TD]
[TD]*Column A Header[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]19[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]25[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
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