Select each alternate row in a worksheet

A

Abdul Shakeel

Hi all,

Could I select each alternate row in my seleceted range of a worksheet,
there is any way to do this.
 
G

Gary''s Student

Try this macro:

Sub everyothre()
Set s = Selection
r1 = s.Cells(1, 1).Row
r2 = s.Rows.Count + r1 - 1
Set cmp = s.Cells(1, 1).EntireRow
For i = r1 To r2 Step 2
Set parts = Cells(i, 1).EntireRow
Set cmp = Union(cmp, parts)
Next
Set cmp = Intersect(cmp, s)
cmp.Select
End Sub
 
Top