Copying and skipping (adding) rows

M

mshall2

Hi.
I have a column of data that runs from row 2:53. I want to paste this
data into another worksheet, but for each line of data I want to skip
down ten rows.
Here's a illustration of the data (immigration data):

Worksheet 1 (Year 1995)
State Afghanistan
Alabama 500
Alaska 100
Arizona 900
.. .
.. .
.. .

Worksheet 2 1995-2005
State Year Afghanistan
Alabama 1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
Alaska 1995
1996
.. .
.. .
.. .

So, I want to paste the Alabam's 1995 from the 1st worksheet into the
1995 year in the 2nd worksheet, skip ten rows down paste Alaska, and so
on...

Thanks for any help.
Matt Hall
Penn State
 
T

Tom Ogilvy

i = 2
for each cell in Worksheets("Sheet1").Range("A2:A53")
Worksheets("Sheet2").Cells(i,1) = cell
yr = 1995
for j = i to i + 11
worksheets("Sheet2").Cells(i,2) = yr
yr = yr + 1
Next
i = i + 12
Next
Worksheets("Sheet2").Range("A1:C1").Value = _
Array("State","Year","Afghanistan")
 

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

Top