Sub blah()
Set myTable = Sheets("Main Sheet").Range("E2").CurrentRegion
Set DestnSht = Sheets(myTable.Cells(1).Value)
DestnRow = DestnSht.Cells(Rows.Count, "A").End(xlUp).Row + 1
ofset = 0
For Each shtName In Intersect(myTable.Rows(1), myTable.Offset(, 1)).Value
ofset = ofset + 1
Set SourceSht = Sheets(shtName)
SourceShtLastRow = SourceSht.Cells(Rows.Count, "A").End(xlUp).Row
If SourceShtLastRow > 1 Then
For Each cll In Intersect(myTable.Columns(1), myTable.Offset(1)).Cells
Application.Goto cll
DestnColm = Application.Match(cll.Value, DestnSht.Rows(1), 0)
If Not IsError(DestnColm) Then
Application.Goto cll.Offset(, ofset)
SourceColm = Application.Match(cll.Offset(, ofset).Value, SourceSht.Rows(1), 0)
If Not IsError(SourceColm) Then
Application.Goto SourceSht.Cells(2, SourceColm).Resize(SourceShtLastRow - 1)
Application.Goto DestnSht.Cells(DestnRow, DestnColm)
SourceSht.Cells(2, SourceColm).Resize(SourceShtLastRow - 1).Copy DestnSht.Cells(DestnRow, DestnColm)
End If
End If
Next cll
DestnRow = DestnRow + SourceShtLastRow - 1
End If
Next shtName
End Sub