# Microsoft Excel help needed -- how do I grab every tenth row?

**URL:** <https://boards.straightdope.com/t/microsoft-excel-help-needed-how-do-i-grab-every-tenth-row/202241>\
**Category:** Factual Questions\
**Created:** [September 17, 2003, 10:47pm UTC](https://boards.straightdope.com/t/microsoft-excel-help-needed-how-do-i-grab-every-tenth-row/202241 "2003-09-17T22:47:30Z")\
**Posts on this page:** 10\
**Page:** 2

<div class="post-metadata">

**Author:** ![muttrox](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@muttrox](https://boards.straightdope.com/u/muttrox)\
**Post date:** [September 18, 2003, 1:04pm UTC](https://boards.straightdope.com/t/microsoft-excel-help-needed-how-do-i-grab-every-tenth-row/202241/21 "2003-09-18T13:04:13Z")

</div>

Listen to shijinn and don’t ask. Simply picking every 10th row is not good methodology.

---

<div class="post-metadata">

**Author:** ![Jpeg\_Jones](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@Jpeg\_Jones](https://boards.straightdope.com/u/Jpeg_Jones)\
**Post date:** [September 18, 2003, 5:13pm UTC](https://boards.straightdope.com/t/microsoft-excel-help-needed-how-do-i-grab-every-tenth-row/202241/22 "2003-09-18T17:13:16Z")

</div>

True. The whole purpose of your exercise is to find a random sampling of 10%. Not “every tenth row”.

Here’s another thought: How is the original list sorted? Name? Address? You could take the first 500 rows based on nearly any sorted column and come up with a random sampling. Maybe even simply the first 500 rows of the original list. You might not have needed to do any of this weird formula stuff!

---

<div class="post-metadata">

**Author:** ![More\_Cowbell](https://avatars.discourse-cdn.com/v4/letter/m/b5a626/32.png) [@More\_Cowbell](https://boards.straightdope.com/u/More_Cowbell)\
**Post date:** [September 18, 2003, 5:36pm UTC](https://boards.straightdope.com/t/microsoft-excel-help-needed-how-do-i-grab-every-tenth-row/202241/23 "2003-09-18T17:36:53Z")

</div>

While every tenth row is not a good way to pick a sample, a macro would be much simpler.

Sub Macro1()  
x = 1  
For x = 1 To 5000  
Cells(x, 1).Select  
Selection.EntireRow.Delete  
x = x + 10  
Next x  
End Sub

X is the first row of your spreadsheet (if it has a header then you can change it to 3 or 5 or whatever you need). The 5000 is the row size. If it was 700 people, change it to 700.

You can copy and paste this right in. TOOLS\>MACRO\>VISUAL BASIC EDITOR. In the Visual Basic Editor, INSERT\>MODULE. The window that pops up, paste in the above macro and you are done. Go back to the Excel, TOOLS\>MACRO\>MACRO and you should have only one choice, Macro1.

---

<div class="post-metadata">

**Author:** ![spectrum](https://avatars.discourse-cdn.com/v4/letter/s/9fc29f/32.png) [@spectrum](https://boards.straightdope.com/u/spectrum)\
**Post date:** [September 18, 2003, 5:45pm UTC](https://boards.straightdope.com/t/microsoft-excel-help-needed-how-do-i-grab-every-tenth-row/202241/24 "2003-09-18T17:45:14Z")

</div>

I ended up doing the random number, sorting by that, and pulling out the first 500 entries to form the list. Which as a bonus, is a true random sample, which the every tenth whatever wouldn’t have been.

Thanks again everyone.

---

<div class="post-metadata">

**Author:** ![Shade](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@Shade](https://boards.straightdope.com/u/Shade)\
**Post date:** [September 18, 2003, 6:28pm UTC](https://boards.straightdope.com/t/microsoft-excel-help-needed-how-do-i-grab-every-tenth-row/202241/25 "2003-09-18T18:28:51Z")

</div>

Memo to self: if I ever ask for advice, be sure I’m asking for what I really want, not how I assumed it would be done. It’s hard to figure out if I’m unfamiliar with the tool, but it helps a lot.

That’s not a dig, spectrum, it’s just something useful for me, and I think others, to remember

---

<div class="post-metadata">

**Author:** ![Cardinal](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/cardinal/32/4000_2.png) [@Cardinal](https://boards.straightdope.com/u/Cardinal)\
**Post date:** [September 18, 2003, 6:40pm UTC](https://boards.straightdope.com/t/microsoft-excel-help-needed-how-do-i-grab-every-tenth-row/202241/26 "2003-09-18T18:40:58Z")

</div>

OK, instead of starting a new Excel thread, I’ll put this here.

I’ve lost the macro toolbar. It’s just not there when I try to record a macro, and without it, I don’t know how to make sure that I’m recording in relative reference instead of absolute.

Ideas?

---

<div class="post-metadata">

**Author:** ![More\_Cowbell](https://avatars.discourse-cdn.com/v4/letter/m/b5a626/32.png) [@More\_Cowbell](https://boards.straightdope.com/u/More_Cowbell)\
**Post date:** [September 18, 2003, 7:12pm UTC](https://boards.straightdope.com/t/microsoft-excel-help-needed-how-do-i-grab-every-tenth-row/202241/27 "2003-09-18T19:12:35Z")

</div>

Lost the macro toolbar? :dubious:

Unless I’m misunderstanding you, you should be able to go to the menu VIEW\>TOOLBARS\>VISUAL BASIC and it should pop up.

---

<div class="post-metadata">

**Author:** ![Cardinal](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/cardinal/32/4000_2.png) [@Cardinal](https://boards.straightdope.com/u/Cardinal)\
**Post date:** [September 18, 2003, 7:18pm UTC](https://boards.straightdope.com/t/microsoft-excel-help-needed-how-do-i-grab-every-tenth-row/202241/28 "2003-09-18T19:18:21Z")

</div>

No, I mean the little one with the button to turn on the relative reference function for recording your macros. I see what you mean, but that one does not have a relative reference button.

There was a little two button bar that would come up when I recorded a macro, but for no discernable reason, it’s gone. It simply doesn’t appear any more.

---

<div class="post-metadata">

**Author:** ![More\_Cowbell](https://avatars.discourse-cdn.com/v4/letter/m/b5a626/32.png) [@More\_Cowbell](https://boards.straightdope.com/u/More_Cowbell)\
**Post date:** [September 18, 2003, 7:29pm UTC](https://boards.straightdope.com/t/microsoft-excel-help-needed-how-do-i-grab-every-tenth-row/202241/29 "2003-09-18T19:29:43Z")

</div>

Gotcha! I thought that may have been what you were talking about.

VIEW\>TOOLBARS\>CUSTOMIZE and go to the TOOLBARS tab. Check on the STOP RECORDING checkbox and you should get your toolbar back, complete with the Relative Reference button.

---

<div class="post-metadata">

**Author:** ![Cardinal](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/cardinal/32/4000_2.png) [@Cardinal](https://boards.straightdope.com/u/Cardinal)\
**Post date:** [September 18, 2003, 7:51pm UTC](https://boards.straightdope.com/t/microsoft-excel-help-needed-how-do-i-grab-every-tenth-row/202241/30 "2003-09-18T19:51:47Z")

</div>

Thank you thank you thank you thank you.

Ahhhhhhhhhhh…

[Previous page](https://boards.straightdope.com/t/microsoft-excel-help-needed-how-do-i-grab-every-tenth-row/202241.md?page=1)
