Macro to combine data from Multiple Excel Worksheets

  Рет қаралды 6,169

Ajay Anand

Ajay Anand

9 ай бұрын

Excel Macro to combine data from Multiple Worksheets of a Workbook is explained in this video.
🍐Join my online course on Excel Tables
www.udemy.com/course/tables-i...
🍓Download my free eBook on Excel Macros
eepurl.com/gpT0RD
🍇Check these Books on Excel
xlncad.com/excel-resources/
🍉Read my articles on Excel
xlncad.com/
🍏Playlist for Shorts on Excel
• Short videos on Excel ...
VBA code to combine data from Multiple Worksheets of an Excel Workbook
Sub Combine_WorkSheets()
Dim sRow, sCol, lRow, lCol As Long
Dim hdrs As Range
For Each Sheet In ActiveWorkbook.Worksheets
If Sheet.Name = "Master" Then
Application.DisplayAlerts = False
Worksheets("Master").Delete
Application.DisplayAlerts = True
End If
Next Sheet
Sheets.Add.Name = "Master"
Set mtr = Worksheets("Master")
Set wb = ActiveWorkbook
Set hdrs = Application.InputBox("Select the headers", Type:=8)
hdrs.Copy mtr.Range("A1")
sRow = hdrs.Row + 1
sCol = hdrs.Column
Debug.Print sRow, sCol
For Each ws In wb.Worksheets
If ws.Name (not equal to, replace with angled brackets) "Master" Then
ws.Activate
lRow = Cells(Rows.Count, sCol).End(xlUp).Row
lCol = Cells(sRow, Columns.Count).End(xlToLeft).Column
Range(Cells(sRow, sCol), Cells(lRow, lCol)).Copy _
mtr.Range("A" & mtr.Cells(Rows.Count, 1).End(xlUp).Row + 1)
End If
Next ws
Worksheets("Master").Activate
ActiveWindow.Zoom = 115
End Sub
#excelmacro #vbatutorial #combineworksheets

Пікірлер: 4
@MohAboAbdo
@MohAboAbdo 5 ай бұрын
Thank you so much
@cadphilpo1564
@cadphilpo1564 4 ай бұрын
thanks, you are a hero. If you could please share a macro code where you want to copy the autosum from a Column to a different worksheet
@laisonkc
@laisonkc 9 ай бұрын
Can you share the VBA code mentioned in the video, I am unable to copy the same from the description box. Thank you very much for the efforts to create the code. This video will help me more , presently I am doing as mannual mode.
@Arun.123.
@Arun.123. 8 ай бұрын
How to connect 2sheets in excel with if conditional format like if sheet1B118=20-10-2023,Sheet2C118=Sheet1B17.kindly reply.
Excel Macro to combine multiple Excel Workbooks
7:45
Ajay Anand
Рет қаралды 25 М.
DEFINITELY NOT HAPPENING ON MY WATCH! 😒
00:12
Laro Benz
Рет қаралды 21 МЛН
🤔Какой Орган самый длинный ? #shorts
00:42
Я нашел кто меня пранкует!
00:51
Аришнев
Рет қаралды 4,3 МЛН
How to Combine Multiple Excel Files using VBA
19:06
Excel Macro Mastery
Рет қаралды 31 М.
How to Combine Multiple Excel Workbooks into One
4:52
Technology for Teachers and Students
Рет қаралды 20 М.
Personal Macro Workbook - Reuse Macros in Any Workbook in Excel
8:29
Excel VBA Combine Multiple Workbooks Into One
11:11
The Excel Cave
Рет қаралды 16 М.
VBA to BROWSE & COPY Data from SELECTED File in Excel
10:00
Leila Gharani
Рет қаралды 322 М.
DEFINITELY NOT HAPPENING ON MY WATCH! 😒
00:12
Laro Benz
Рет қаралды 21 МЛН