Link to home
Start Free TrialLog in
Avatar of Carlynne
Carlynne

asked on

Extracting Every 19 Records in Excel to Create Random Sample

Hi,

I'd like to take my spreadsheet and extract every 19 records starting with record 1069 to create a random sample.  Should I create a macro or function to tell Excel to select every 19 records?

Please see attached worksheet.

Thanks,
carlynne
--S1-Select.xlsx
Avatar of Makrini
Makrini
Flag of Australia image

The file you attached appears to be corrupted (and has 0 bytes)

Simply run a Macro to copy every 19th row

for i = 1 to 64000 step 19
   Rows(i).copy
Next i

Open in new window

Avatar of Carlynne
Carlynne

ASKER

Hi,

Thanks very much for your reply.

I am not sure how to insert a macro. The code should also start at record 1069.

I'd really appreciate further assistance if possible.  Here's the sheet again.

Thanks so much!

Carlynne


Data-Sample.xlsx
Hi there,

Thanks so much for your quick reply.  The code does select the correct first record 1069 but it only selects 135 households. I need a sample size of 192.

Also, I have to run a simple coding on 8 more spreadsheets, so I need to be able to insert the macro. I can insert a Marco. I just need to be able to see the code in a separate worksheet.

Thanks so much! You're a star!

Carlynne
ASKER CERTIFIED SOLUTION
Avatar of Makrini
Makrini
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi,

Ah, yeah, that makes sense.  

I really appreciate your help. I will try this and let you know if it works:)

carlynne
thank you!