I want to select every 10th line of data in an excel spreadsheet?

  • Thread starter Thread starter Matloter
  • Start date Start date
One way... This starts at row 2 and selects every 10th populated row after
that...

Sub Select10Th()
Dim rng As Range
Dim rngAll As Range

Set rng = Rows(2)
Set rngAll = rng
Do While Application.WorksheetFunction.CountA(rng) > 0
Set rngAll = Union(rng, rngAll)
Set rng = rng.Offset(10, 0)
Loop
rngAll.Select
End Sub
 
Here's one way

If A10:A200 contains your data,
with A10 the column heading (eg....MyData)

Try this:

A1: Crit
A2: =MOD(ROW(A11),10)=0

Note: That formula refers to the FIRST DATA cell, NOT the heading

Select A10:A200

From the Excel Main Menu:
<data><filter><advanced filter>
Criteria Range: $A$1:$A$2
Click [OK]

Now only these data rows will be displayed:
20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120,
130, 140, 150, 160, 170, 180, 190, 200


Is that something you can work with?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)
 
Back
Top