Option Explicit
Sub Testo()
Dim i As Integer
Dim j As Integer
Dim ar As Variant
Sheet2.[A2:Z2000].ClearContents
ar = Sheet2.Range("A1", Sheet2.Range("IV1").End(xlToLeft))
For i = 1 To Sheet2.Range("IV1").End(xlToLeft).Column
j = [a1:Z1].Find(ar(1, i)).Column
Range(Cells(2, j), Cells(Rows.Count, j).End(xlUp)).Copy Sheet2.Cells(2, i)
Next i
End Sub
j = Range("A1", Range("IV1").End(xlToLeft)).Find(ar(1, i)).Column
Option Explicit
Sub Testo()
Dim i As Integer, lastRow As Long
Dim ar As Range, PstRng As Range
lastRow = Range("A" & Rows.Count).End(xlUp).Row
Sheet2.[A1].CurrentRegion.Offset(1).ClearContents
Set ar = Sheet2.Range("A1", Sheet2.Cells(1, Columns.Count).End(xlToLeft))
For i = 1 To Cells(1, Columns.Count).End(xlToLeft).Column
Set PstRng = ar.Find(Cells(1, i).Value, [A1], xlValues, xlWhole)
If Not PstRng Is Nothing Then
Range(Cells(2, i), Cells(lastRow, i)).Copy PstRng.Offset(1, 0)
End If
Next i
End Sub
Option Explicit
Sub Testo()
Dim i As Integer
Dim j As Integer
Dim ar As Variant
Sheet2.[A1].CurrentRegion.Offset(1).ClearContents
ar = Sheet2.Range("A1", Sheet2.Range("IV1").End(xlToLeft))
For i = 1 To Sheet2.Range("IV1").End(xlToLeft).Column
j = Range("A1", Range("IV1").End(xlToLeft)).Find(ar(1, i)).Column
Range(Cells(2, j), Cells(Rows.Count, j).End(xlUp)).Copy Sheet2.Cells(2, i)
Next i
End Sub