![]() |
How can I choose every nth name in a spreadsheet?
I need to take a random sample of names from a spreadsheet. I would like to
choose every Nth name in the sheet. Does anyone know how to do that? |
How can I choose every nth name in a spreadsheet?
Add a helper column with a formula of
=ROW()=INT(ROW()/n)*n and copy down. Filter on the TRUE values -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Rechnem" wrote in message ... I need to take a random sample of names from a spreadsheet. I would like to choose every Nth name in the sheet. Does anyone know how to do that? |
How can I choose every nth name in a spreadsheet?
try
Sub selectnrows() 'n = 3 'or n = InputBox("how many") Rows.Hidden = False For i = 1 To Cells(Rows.Count, "a").End(xlUp).Row Step n Cells(i, "a").Resize(n - 1, 1).EntireRow.Hidden = True 'MsgBox i Next i End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Rechnem" wrote in message ... I need to take a random sample of names from a spreadsheet. I would like to choose every Nth name in the sheet. Does anyone know how to do that? |
How can I choose every nth name in a spreadsheet?
Use a helper cell, number from 1 to N down the rows, select the 1 to N
cells, and copy, then Paste in starting at the first blank cell after N, now sort on that column and then pick a group randomly, any number 1 through N. Rechnem wrote: I need to take a random sample of names from a spreadsheet. I would like to choose every Nth name in the sheet. Does anyone know how to do that? |
All times are GMT +1. The time now is 08:37 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com