How to grab every 10th row


Posted by Stephen on September 12, 2000 4:23 PM

Hello,

I have a data file that I want to take every tenth row, but do not have a good col to filter. Please let me know if it is possible.

Stephen

Posted by David on September 13, 0100 1:01 AM

You just want to take data in rows of multiples of ten and move them? I don't realy understand what you are doing.

Posted by Stephen on September 13, 0100 8:37 AM

Re: Here is More info


What I have is thousands of saved instrument readings, one every 5 seconds. The goal is to pull one reading for every 30 min. regardless the reading. First col is in time format 10:12:05, is a filter that will let me pull every 30 min.



Posted by Celia on September 13, 0100 5:35 PM

Re: Here is More info


Stephen
Your explanation is not too clear. It contains inconsistent requirements.
However, I’ll assume that you want to show every nth row (starting from "start") and hide all other rows :-

Sub Show_Every_nth_Row()
Dim start As Range, toHide As Range, n As Integer
Set start = Range("A4") 'Column A cell in first row of data
n = 10 'Every nth row to be shown
Application.ScreenUpdating = False
Set toHide = Range(start.Offset(1, 0), start.Offset(n - 1, 0))
Do Until Application.WorksheetFunction.CountA(toHide) = 0
toHide.EntireRow.Hidden = True
Set start = start.Offset(n, 0)
Set toHide = toHide.Offset(n, 0)
Loop
End Sub

Change the "start" cell reference and the value of "n" to fit your requirements.

Celia