I'm using the following code to copy/paste data from one workbook to another using the header values. It works, but I'm needing it to paste special. Any ideas?
Dim ws As Worksheet, ws2 As Worksheet, x As Range, i As Long, y As Long
Set ws = Workbooks("ManagerWorkbook.xlsm").Sheets("CurrentPayroll")
Set ws2 = Workbooks("Import Education Timesheets.xlsm").Sheets("Import")
With ws
For i = 1 To .UsedRange.Columns.Count
Set x = ws2.Rows(5).Find(ws.Cells(1, i).Value, LookIn:=xlValues, lookat:=xlWhole)
If Not x Is Nothing Then
y = .Cells(Rows.Count, i).End(3).Row
.Range(.Cells(2, i), .Cells(y, i)).Copy ws2.Cells(6, x.Column)
End If
Set x = Nothing
Next i
End With
Thanks!!
Bookmarks