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

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
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
 
Upvote 0
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.
 
Upvote 0
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
 
Upvote 0
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...
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,252
Members
452,623
Latest member
Techenthusiast

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