
Hi,
Anyone can help me to understand how to add a new column in summary tab after or before copying data from multiple sheet into one?
Example: to add a new column "description" after column B at summary page.
Thank you.
Sub CombineSheet1()
Dim i As Integer
Dim Lr As Long
Dim wksDst As Worksheet
Set wksDst = Worksheets("Summary")
For i = 2 To Sheets.Count
Lr = wksDst.Cells(Rows.Count, 1).End(xlUp).Row + 1
Sheets(i).Cells(1, 1).CurrentRegion.Offset(1).Copy wksDst.Cells(Lr, "A")
Next i
End Sub

VIP

Trusted Members

June 25, 2016

Hi Chiew Yen
Try this
Sub CombineSheet1()
Dim i As Integer
Dim Lr As Long
Dim wksDst As Worksheet
Set wksDst = Worksheets("Summary")
For i = 2 To Sheets.Count
Lr = wksDst.Cells(Rows.Count, 1).End(xlUp).Row + 1
Sheets(i).Cells(1, 1).CurrentRegion.Offset(1).Copy wksDst.Cells(Lr, "A")
Next i
'Insert Column
Columns("C:C").Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("C1") = "Description"
End Sub
You can easily record a macro to insert the column.
Hope this helps.
Sunny

Answers Post
1 Guest(s)
