Select each alternate row in a worksheet
Hi all,
Could I select each alternate row in my seleceted range of a worksheet, there is any way to do this. |
Select each alternate row in a worksheet
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 -- Gary''s Student - gsnu200798 "Abdul Shakeel" wrote: Hi all, Could I select each alternate row in my seleceted range of a worksheet, there is any way to do this. |
All times are GMT +1. The time now is 08:15 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com