Excel row removal/selection

kateo - Jul 14, 2008 at 10:54 AM
 amaresh - Jun 4, 2011 at 07:26 AM
I am trying to select certain rows from a very large data sheet. Ideally I would like to select every 25th row so as to get a random sample of data.
I've tried filters, row functions & formulas but nothing seems to work.
I'd appreciate any suggestions.
Many thanks,

3 responses

Ivan-hoe Posts 433 Registration date Saturday February 16, 2008 Status Member Last seen October 17, 2008 110
Jul 14, 2008 at 04:39 PM
I do not think there is any solution with filters ; using formulas would be quite complicated. I suggest you use the macro below, which selects every 25th row from row 2.
Sub Kateo()
    Dim MyRange As Range, i As Integer
    Set MyRange = Rows(2)
    For i = MyRange.Row To Cells(Rows.Count, "A").End(xlUp).Row Step 25
        Set MyRange = Union(MyRange, Rows(i))
    Next i
End Sub

I've got a frustrating Excel Vba question (I've fought with this one for a while).

I'm trying to group values of column 2 based on column 4 values on sheet A (distinct values from column 4 - matching values from column 2).

These found values should be concatenated on sheet B according to the same column 4 value.

Any suggestions?

Thanks, Elja
Do you know how you would alter that so it would select cells in column A only, instead of the whole row?
I can send you sheet to extract every nth or 25 th row of the total records.
Please reply me if you need it.
hello umesh,

i use this formula when i want to select every nth row. Try this out.


where 3 refers to nth row. If you are in need of 25th row, =mod(row(a1),25) & then use filters.