How do I create a sample in Excel?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to create a sample, needing every 20th record out of around 3000
records.
 
Mary,

You need a VBA procedure.

Sub AAA()
Dim RowNdx As Long
Dim DestRng As Range
Set DestRng = Worksheets("Sheet2").Range("A1")
For RowNdx = 1 To 3000 Step 20
Rows(RowNdx).Copy Destination:=DestRng
Set DestRng = DestRng(2, 1)
Next RowNdx
End Sub



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top