+ Reply to Thread
Results 1 to 4 of 4

copy rows from different worksheets into one worksheet

  1. #1
    Registered User
    Join Date
    08-24-2011
    Location
    Costa Rica
    MS-Off Ver
    Excel 2011
    Posts
    3

    copy rows from different worksheets into one worksheet

    Hi

    I am trying to use excel to generate html code. I would like to copy a row from each worksheet onto one worksheet. I have 16 worksheets. Once the first row is copied from each worksheet on different rows in the destination worksheet, i leave a blank row. then i copy the 2nd row from each worksheet and so on till we reach the last row on the first worksheet.

    I am attaching a sample of the workbook. Sheet1 is the destination worksheet. I would like to thank everybody in advance for the same.

    Cheers
    Vivek
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor Steffen Thomsen's Avatar
    Join Date
    10-15-2010
    Location
    Kolding, Denmark
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    953

    Re: copy rows from different worksheets into one worksheet

    Hi,

    Try this and sse if it's what you want.

    The final html code sheet has to be the last, it can be modified though

    Please Login or Register  to view this content.
    Steffen Thomsen

  3. #3
    Registered User
    Join Date
    08-24-2011
    Location
    Costa Rica
    MS-Off Ver
    Excel 2011
    Posts
    3

    Re: copy rows from different worksheets into one worksheet

    thanks a lot steffen. great help... sorry about the delay in acknowleding your help. I modified it slightly to achieve the desired result.
    ////////////////////////////////
    Sub steffen()

    Dim w As Integer
    Dim x As Integer

    w = 2
    x = 1

    Dim ws As Worksheet

    wsCount = ActiveWorkbook.Worksheets.Count

    MsgBox (wsCount)

    For r = 1 To 4 ' adjust to how many rows you need 2 copy
    For i = 1 To wsCount
    Sheets(i).Range("B" & w).Copy
    Sheets(17).Range("A" & x).Insert
    x = x + 1
    Next i
    w = w + 1
    Next r
    End Sub
    ///////////////////
    Thanks a ton again.

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: copy rows from different worksheets into one worksheet

    Please use code tags....


    Please Login or Register  to view this content.



+ 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