Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default Combin / Merge Multiple Worksheets / sheets into one worksheet / sheet

I have several worksheet in one file

e.g

SHEET1
Name Number Field Qty Age
John 7878 8989 234 32
Peter 7877 23 9 NA
Mike 3433 343 --

Sheet2
Name Number Field Qty Age
Shart 343 343
William 323 52 5

I just want to combine into one worksheet as follows

New Sheet

Name Number Field Qty Age
John 7878 8989 234 32
Peter 7877 23 9 NA
Mike 3433 343 --

Name Number Field Qty Age
Shart 343 343
William 323 52 5

any advice

thanks

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Combin / Merge Multiple Worksheets / sheets into one worksheet / s

Can you use Copy and Paste to the new sheet


" wrote:

I have several worksheet in one file

e.g

SHEET1
Name Number Field Qty Age
John 7878 8989 234 32
Peter 7877 23 9 NA
Mike 3433 343 --

Sheet2
Name Number Field Qty Age
Shart 343 343
William 323 52 5

I just want to combine into one worksheet as follows

New Sheet

Name Number Field Qty Age
John 7878 8989 234 32
Peter 7877 23 9 NA
Mike 3433 343 --

Name Number Field Qty Age
Shart 343 343
William 323 52 5

any advice

thanks


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 694
Default Combin / Merge Multiple Worksheets / sheets into one worksheet / s

Tarone,

Try this, you may need to consider pastespecial values:

Option Explicit

Sub makesummarycopy()

Dim lRow As Long ' start row for pasting
Dim lws As Long ' worksheet number
Dim wsNew As Worksheet ' summary worksheet
Dim ws As Worksheet ' worksheet copying

On Error GoTo Finished

Set wsNew = ActiveWorkbook.Worksheets.Add(Worksheets(1))
wsNew.Name = "Summary" ' name it

lRow = 1 ' start row for pasting

For lws = 2 To ActiveWorkbook.Worksheets.Count ' loop thru sheets
Set ws = ActiveWorkbook.Worksheets(lws)
wsNew.Cells(lRow, 1) = "Sheet: " & ws.Name 'insert title
lRow = lRow + 1
ws.UsedRange.Copy (wsNew.Cells(lRow, 1)) ' copy the used range
' may need to consider copy pastespecial....
lRow = lRow + ws.UsedRange.Rows.Count + 1 ' increment the rows
Next lws

Finished:
End Sub

--
Hope this helps
Martin Fishlock
Please do not forget to rate this reply.


" wrote:

I have several worksheet in one file

e.g

SHEET1
Name Number Field Qty Age
John 7878 8989 234 32
Peter 7877 23 9 NA
Mike 3433 343 --

Sheet2
Name Number Field Qty Age
Shart 343 343
William 323 52 5

I just want to combine into one worksheet as follows

New Sheet

Name Number Field Qty Age
John 7878 8989 234 32
Peter 7877 23 9 NA
Mike 3433 343 --

Name Number Field Qty Age
Shart 343 343
William 323 52 5

any advice

thanks


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default Combin / Merge Multiple Worksheets / sheets into one worksheet / s

There are about 20 to 25 worksheets.

What do you mean by pastspeacial values?

I did copy it in the vb and run but didn;t get correct results.

Any advice.

thanks
Martin Fishlock wrote:
Tarone,

Try this, you may need to consider pastespecial values:

Option Explicit

Sub makesummarycopy()

Dim lRow As Long ' start row for pasting
Dim lws As Long ' worksheet number
Dim wsNew As Worksheet ' summary worksheet
Dim ws As Worksheet ' worksheet copying

On Error GoTo Finished

Set wsNew = ActiveWorkbook.Worksheets.Add(Worksheets(1))
wsNew.Name = "Summary" ' name it

lRow = 1 ' start row for pasting

For lws = 2 To ActiveWorkbook.Worksheets.Count ' loop thru sheets
Set ws = ActiveWorkbook.Worksheets(lws)
wsNew.Cells(lRow, 1) = "Sheet: " & ws.Name 'insert title
lRow = lRow + 1
ws.UsedRange.Copy (wsNew.Cells(lRow, 1)) ' copy the used range
' may need to consider copy pastespecial....
lRow = lRow + ws.UsedRange.Rows.Count + 1 ' increment the rows
Next lws

Finished:
End Sub

--
Hope this helps
Martin Fishlock
Please do not forget to rate this reply.


" wrote:

I have several worksheet in one file

e.g

SHEET1
Name Number Field Qty Age
John 7878 8989 234 32
Peter 7877 23 9 NA
Mike 3433 343 --

Sheet2
Name Number Field Qty Age
Shart 343 343
William 323 52 5

I just want to combine into one worksheet as follows

New Sheet

Name Number Field Qty Age
John 7878 8989 234 32
Peter 7877 23 9 NA
Mike 3433 343 --

Name Number Field Qty Age
Shart 343 343
William 323 52 5

any advice

thanks



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
Repeat printing rows in multiple worksheets KevinG Excel Discussion (Misc queries) 19 November 27th 07 10:42 PM
macro unouwanme Excel Discussion (Misc queries) 9 August 31st 06 09:38 PM
Selecting Last Sheet Bonbon Excel Worksheet Functions 17 February 22nd 06 04:16 PM
linking multiple sheets to a summary sheet greg g Excel Discussion (Misc queries) 1 December 16th 04 07:43 AM
Multiple Worksheets and Print Merge function pfe Excel Discussion (Misc queries) 2 December 2nd 04 11:23 PM


All times are GMT +1. The time now is 10:48 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"