Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
a.pontes
 
Posts: n/a
Default 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   Report Post  
Mohamed Shafiee
 
Posts: n/a
Default

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" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Viewing Worksheets withing One Workbook cagedbirdflies New Users to Excel 1 February 22nd 05 11:09 PM
Search all worksheets in a workbook... Peter Excel Discussion (Misc queries) 6 January 26th 05 11:07 AM
Count the number of worksheets in a workbook Vincdc Excel Discussion (Misc queries) 7 January 17th 05 11:57 PM
how to merge worksheets in the same workbook how to merge worksheets in a workbook Excel Worksheet Functions 3 January 5th 05 08:49 AM
Removing links to other worksheets from within a workbook rjb Excel Discussion (Misc queries) 2 December 9th 04 08:04 AM


All times are GMT +1. The time now is 07:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"