Consolidation of excel sheet

gshinoj

New Member
Joined
Mar 25, 2019
Messages
4
I have multiple excel sheet with same header. I want to merge the data in these excel sheet to one excel sheet with the help of macros. Can any one help.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

James006

Well-known Member
Joined
Apr 4, 2009
Messages
3,680
Hello,

You could test following macro

Code:
Sub CombineAllSheets()
' Combines All Data in All Sheets to main page : Sheet1
Dim i As Long
Dim last1 As Long
Dim lasti As Long
    For i = 2 To Sheets.Count
      last1 = Sheet1.Cells(Application.Rows.Count, "A").End(xlUp).Row + 1
      lasti = Sheets(i).Cells(Application.Rows.Count, "A").End(xlUp).Row + 1
      ' Adjust to your own conditions
      Sheets(i).Range("A2:D" & lasti).Copy Destination:=Sheet1.Range("A" & last1)
    Next i
End Sub

Hope this will help
 

gshinoj

New Member
Joined
Mar 25, 2019
Messages
4
Hello,

You could test following macro

Code:
Sub CombineAllSheets()
' Combines All Data in All Sheets to main page : Sheet1
Dim i As Long
Dim last1 As Long
Dim lasti As Long
    For i = 2 To Sheets.Count
      last1 = Sheet1.Cells(Application.Rows.Count, "A").End(xlUp).Row + 1
      lasti = Sheets(i).Cells(Application.Rows.Count, "A").End(xlUp).Row + 1
      ' Adjust to your own conditions
      Sheets(i).Range("A2:D" & lasti).Copy Destination:=Sheet1.Range("A" & last1)
    Next i
End Sub

Hope this will help
Thank You...
But my datas are in different excel, not in one excel. i want this data to be in one single data.
 

James006

Well-known Member
Joined
Apr 4, 2009
Messages
3,680
Hello,

An Excel file is a Workbook ...

Inside any workbook, you can have several Worksheets ...

So, when it comes to Consolidation, there are two possibilities :

1. Consolidate Worksheets ... (which is the title you have selected ... ) - (several sheets inside the same workbook ...)

Or

2. Consolidate Workbooks ... (which means consolidating several Excel files ...)

Hope this clarifies
 

gshinoj

New Member
Joined
Mar 25, 2019
Messages
4
Hello,

An Excel file is a Workbook ...

Inside any workbook, you can have several Worksheets ...

So, when it comes to Consolidation, there are two possibilities :

1. Consolidate Worksheets ... (which is the title you have selected ... ) - (several sheets inside the same workbook ...)

Or

2. Consolidate Workbooks ... (which means consolidating several Excel files ...)

Hope this clarifies

Thanks for the clarifcation..
My issue is in consolidation of Workbooks...
 

Watch MrExcel Video

Forum statistics

Threads
1,129,573
Messages
5,637,155
Members
416,959
Latest member
Mohzein

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
Top