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.
 

Some videos you may like

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

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,095,174
Messages
5,442,830
Members
405,200
Latest member
Barkworth

This Week's Hot Topics

  • Copy entire row if CountA <>0 to another sheet
    [B]I want to copy entire row if CountA <>0 for column J7:AM7 (headers on J6:AM6) and so on till the last used cell is column D and paste the...
  • Select last used Row in Table
    I have created a Table in a Worksheet which is locked to prevent user errors and protect formula. Some of the cells require freetext entries which...
  • excel workbook: do not allow certain file name
    Hello all, Don't think this has ever been asked before, but how do I restrict file save [Before_Save Event] if the name of the file being saved...
  • fixing problem autofilter
    hello i need help about my code when i search by code in textbox it doesn't show anything this is my data [ATTACH type="full"...
  • “Weight”
    Hi, i’ve got a long sheet filled with weights such as kg,g,L & ml. i can build a formula to convert kg into g and liter into ml. How ever, my...
  • How to capitalize everything before a certain character?
    In column A, I have some text: Hello good day.mp3 Hello good day.flac etc. I'd like to capitalize everything before the period. I don't need the...
Top