+ Reply to Thread
Results 1 to 2 of 2

merging different worksheets in a workbook to one sheet

Hybrid View

  1. #1
    a.pontes
    Guest

    merging different worksheets in a workbook to one sheet

    Is there a macro that I can take a work book that has 8 seperate worksheets
    of data, and put all the data on one worksheet?. I need to sort all the data
    on one sheet. Currently I cut and paste the data to the one sheet.
    Any help would be appreciated.
    Thanks,
    AP



  2. #2
    Mohamed Shafiee
    Guest

    Re: merging different worksheets in a workbook to one sheet

    Hi there...

    This will work.

    Shafiee.

    Sub MakeOneSheet()
    Dim strpasterange As String
    Dim wbk As Excel.Workbook
    Dim awbk As Excel.Workbook
    Set awbk = ActiveWorkbook
    Set wbk = Application.Workbooks.Add
    For i = 1 To ActiveWorkbook.Sheets.Count
    strpasterange = "'[" & wbk.Name & "]" & wbk.Sheets(1).Name & "'!A" &
    wbk.Sheets(1).UsedRange.Rows.Count + 1
    With awbk.Sheets(i)
    .UsedRange.Copy Range(strpasterange)
    End With
    Next

    Set wbk = Nothing
    Set awbk = Nothing
    End Sub

    "a.pontes" <a.pontes@comcast.net> wrote in message
    news:y-idnRiw7qabZb7fRVn-jA@comcast.com...
    > Is there a macro that I can take a work book that has 8 seperate

    worksheets
    > of data, and put all the data on one worksheet?. I need to sort all the

    data
    > on one sheet. Currently I cut and paste the data to the one sheet.
    > Any help would be appreciated.
    > Thanks,
    > AP
    >
    >




+ 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