+ Reply to Thread
Results 1 to 5 of 5

can this be done simply ?

  1. #1

    can this be done simply ?

    I have say 200 rows in sheet 1.

    I want to copy row 1 sheet 1 to row 1 of sheet 2
    row 2 of sheet 1 to row 10 of sheet 2
    row 3 to row 19
    row 4 to row 28

    ROW i gets copied to ROW 9*(i-1) + 1

    Thanks for any help.


  2. #2
    Gary''s Student
    Guest

    RE: can this be done simply ?

    It can be done with a very small macro:

    Sub Macro1()
    Dim r1, r2 As Range
    For i = 1 To 200
    Set r1 = Sheets("Sheet1").Rows(i)
    Set r2 = Sheets("Sheet2").Rows(9 * (i - 1) + 1)
    r1.Copy r2
    Next
    End Sub



    --
    Gary's Student


    "[email protected]" wrote:

    > I have say 200 rows in sheet 1.
    >
    > I want to copy row 1 sheet 1 to row 1 of sheet 2
    > row 2 of sheet 1 to row 10 of sheet 2
    > row 3 to row 19
    > row 4 to row 28
    >
    > ROW i gets copied to ROW 9*(i-1) + 1
    >
    > Thanks for any help.
    >
    >


  3. #3
    Registered User
    Join Date
    05-10-2006
    Posts
    53
    In sheet2, type this in cell A1

    =IF(ISBLANK(Sheet1!A1),"",IF(MOD(ROW(Sheet1!A1),9) = 1, Sheet1!A1, ""))

    Drag the fill handle right and down as much as you need.

    Now you have copied those cells you wanted, but to formalise the values, you just copy the cells on sheet2, and then paste special back on the selected area, values.

  4. #4

    Re: can this be done simply ?


    Gary''s Student wrote:
    > It can be done with a very small macro:
    >
    > Sub Macro1()
    > Dim r1, r2 As Range
    > For i = 1 To 200
    > Set r1 = Sheets("Sheet1").Rows(i)
    > Set r2 = Sheets("Sheet2").Rows(9 * (i - 1) + 1)
    > r1.Copy r2
    > Next
    > End Sub
    >
    >
    >
    > --
    > Gary's Student
    >
    >


    worked like a charm.

    Thank you very much.

    > "[email protected]" wrote:
    >
    > > I have say 200 rows in sheet 1.
    > >
    > > I want to copy row 1 sheet 1 to row 1 of sheet 2
    > > row 2 of sheet 1 to row 10 of sheet 2
    > > row 3 to row 19
    > > row 4 to row 28
    > >
    > > ROW i gets copied to ROW 9*(i-1) + 1
    > >
    > > Thanks for any help.
    > >
    > >



  5. #5

    Re: can this be done simply ?


    KellTainer wrote:
    > In sheet2, type this in cell A1
    >
    > =IF(ISBLANK(Sheet1!A1),"",IF(MOD(ROW(Sheet1!A1),9) = 1, Sheet1!A1,
    > ""))
    >
    > Drag the fill handle right and down as much as you need.
    >
    > Now you have copied those cells you wanted, but to formalise the
    > values, you just copy the cells on sheet2, and then paste special back
    > on the selected area, values.
    >
    >
    > --
    > KellTainer



    The macro worked , but I can' t get this method to work. It does do
    something but not what I want.
    > ------------------------------------------------------------------------
    > KellTainer's Profile: http://www.excelforum.com/member.php...o&userid=34322
    > View this thread: http://www.excelforum.com/showthread...hreadid=550710



+ 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