Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- With ThisWorkbook.Worksheets("Sheet1")
- Dim ar As Variant
- Dim i As Integer
- Dim j As Long
- ar = Array("Header1", "Header2") 'define header names to move
- For i = 0 To UBound(ar)
- j = [A1:AW1].Find(ar(i)).Column
- Columns(j).Copy Sheet2.Cells(1, i + 1) 'copy to sheet2 from sheet1
- Next I
- End With
- End Sub
- j = [A1:AW1].Find(ar(i)).Column
- Dim f As Range
- Set f = Range("A1:AW1").Find(arr(i),lookat:=xlwhole)
- If Not f Is Nothing Then
- f.Entirerow.Copy Sheet2.Cells(1, i + 1)
- End If
Add Comment
Please, Sign In to add comment