I have a multiple worksheets majority of have same header but one(1) worksheet has different header
I have this code that will combine them all
Sub combined()
Dim xWs As Worksheet
On Error Resume Next
Set xWs = ActiveWorkbook.Worksheets.Add(Sheets(1))
xWs.name = "Combined"
Worksheets(2).Range("A1").EntireRow.Copy Destination:=xWs.Range("A1")
For i = 2 To Worksheets.Count
Worksheets(i).Range("A1").CurrentRegion.Offset(1, 0).Copy _
Destination:=xWs.Cells(xWs.UsedRange.Cells(xWs.UsedRange.Count).Row + 1, 1)
Next
Dim s As Worksheet, t As String
Dim j As Long, K As Long
K = Sheets.Count
For j = K To 1 Step -1
t = Sheets(j).name
If t <> "Combined" Then
Application.DisplayAlerts = False
Sheets(j).Delete
Application.DisplayAlerts = True
End If
Next j
End Sub
it works well but I want my 1 sheet to be inserted on column D to it's last column
sheet3 doesn't contains the first 3 columns of the other sheet example
sheet1, sheet2 and sheet 4 contains this columns
Branch | Population | Store | name | age | ...
while sheet3 contains
name | age | ...
the rest are the same only on the first 3 columns are not. I don't what am I going to add to the code to insert it on its designated column.
oh they contains different data values
thanks!