+ Reply to Thread
Results 1 to 2 of 2

Copying and skipping (adding) rows

  1. #1

    Copying and skipping (adding) rows

    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


  2. #2
    Tom Ogilvy
    Guest

    Re: Copying and skipping (adding) rows

    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")

    --
    Regards,
    Tom Ogilvy


    <[email protected]> wrote in message
    news:[email protected]...
    > 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
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1