Try this
Code:
Public Sub GetData()
Dim target As Worksheet
Dim testdate As Date
Dim nextrow As Long
Dim lastrow As Long
Dim i As Long
Application.ScreenUpdating = False
Set target = Worksheets("Data")
With target
lastrow = .Cells(.Rows.Count, "N").End(xlUp).Row
End With
With Worksheets("Money")
If .Cells(42, "B").Value = vbNullString Then
nextrow = 42
ElseIf .Cells(43, "B").Value = vbNullString Then
nextrow = 43
Else
nextrow = Cells(42, "B").End(xlDown).Row + 1
End If
For i = 2 To lastrow
testdate = 0
On Error Resume Next
testdate = DateSerial(Year(Date), target.Cells(i, "N").Value, target.Cells(i, "O").Value)
On Error GoTo 0
If testdate = Date Then
.Cells(nextrow, "B").Value = Date
target.Cells(i, "P").Resize(1, 4).Copy .Cells(nextrow, "C")
target.Cells(i, "T").Resize(1, 2).Copy .Cells(nextrow, "H")
target.Cells(i, "V").Copy .Cells(nextrow, "G")
nextrow = nextrow + 1
End If
Next i
End With
Application.ScreenUpdating = True
End Sub
Bookmarks