If IsError(Cells(target.Row, 39) / Application.WorksheetFunction.VLookup(Cells(target.Row, 1).Value, Range("A:AP"), 39, False).Value) Then
Cells(target.Row, 41) = 0
Else
Cells(target.Row, 41) = Cells(target.Row, 39) / Application.WorksheetFunction.VLookup(Cells(target.Row, 1).Value, Range("a:ap"), 39, False)
End If