Merge multiple sheets in to one

balima

New Member
Joined
Dec 11, 2003
Messages
3
Hello everybody!

I'm a new excel user and I need help to combine multiple sheets from one workbook in to one sheet.

I actually came across a macro by Nehpets12 that does the job nicely but I need the copying to start at cell A12.

Sub Merge()
Dim ws As Worksheet
ActiveSheet.UsedRange.Offset(0).Clear
For Each ws In ActiveWorkbook.Worksheets
If ws.Name <> ActiveSheet.Name Then
ws.UsedRange.Copy
Range("A65536").End(xlUp).Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
End If
Next
End Sub

Thanks in Advance
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
The code that you referred me as a nice feature that allows me customize the start range.
How can I include that feature in the first code?
Cause having to select each sheet would be time consuming since I will be creating at least 10 sheets per day.

Thanks again
 
Upvote 0
Welcome to the Board!

I just tweaked the code that you referenced above:
Code:
Sub Merge()
    Dim ws As Worksheet
        ActiveSheet.UsedRange.Offset(0).Clear
            For Each ws In ActiveWorkbook.Worksheets
                If ws.Name <> ActiveSheet.Name Then
                    ws.UsedRange.Offset(11).Copy
                        With Range("A65536").End(xlUp).Offset(1, 0)
                            .PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
                            False, Transpose:=False
                            .PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _
                            False, Transpose:=False
                        End With
                End If
            Next
End Sub
Hope that helps,

Smitty
 
Upvote 0
Welcome to the Board!

I just tweaked the code that you referenced above:
Code:
Sub Merge()
    Dim ws As Worksheet
        ActiveSheet.UsedRange.Offset(0).Clear
            For Each ws In ActiveWorkbook.Worksheets
                If ws.Name <> ActiveSheet.Name Then
                    ws.UsedRange.Offset(11).Copy
                        With Range("A65536").End(xlUp).Offset(1, 0)
                            .PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
                            False, Transpose:=False
                            .PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _
                            False, Transpose:=False
                        End With
                End If
            Next
End Sub
Hope that helps,

Smitty



I have 31 sheets and few sheets with different data. I want only first 31 sheets need to be copied, above code works, but problem every sheets copied and If any of sheets have rows hidden or filtered, then that portion wont be copied. How can I copy every cell starting from row 9 thru until row is not equal to blank? (Starting from row 9, but if any row a column is blank then do not copy also.
 
Upvote 0
hey guys im kinda new to macros...can you please tell me how do i intiate the macro is it on the new excel sheet to consolidate.....can you guys please help me out if you guys have a video il be really gratefull......need to do consolidation it takes hours to do....please help...
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top