Hello phelbin,
Try it this way,
Option Explicit
Sub Copy1()
Application.ScreenUpdating = False
Dim ws As Worksheet
Dim ws2 As Worksheet
Dim i As Long, x As Range, v As Variant, Y As Long
Set ws = Worksheets("Sheet1")
Set ws2 = Worksheets("Timesheet1")
With ws
For i = 1 To .UsedRange.Columns.Count
Set x = ws2.Rows(4).Find(ws.Cells(1, i).Value, LookIn:=xlValues, lookat:=xlWhole)
If Not x Is Nothing Then
v = ws.Cells(1, i)
Y = .Cells(Rows.Count, i).End(3).Row
If Y > 1 Then
.Range(.Cells(2, i), .Cells(Y, i)).Copy
ws2.Cells(5, x.Column).PasteSpecial xlValues
End If
End If
Set x = Nothing
Next i
End With
ws2.Columns.AutoFit
Application.CutCopyMode = False
End Sub
@ AB33,
Great stuff my friend!
Regards.
Bookmarks