I think you'd better clean up the 'invoer'sheet :
delete column A
remove spaces in columns after the last numerical data.
It's even simpler with:
Sub snb()
On Error Resume Next
With ThisWorkbook.Sheets("Invoer").UsedRange
With .Columns(1)
jj = 1
.AutoFilter 1, "Medewerker*", xlOr, "Conversie"
For Each cl In .Offset(1).SpecialCells(xlCellTypeVisible)
If Left(cl.Value, 1) = "M" Then
If jj = 1 Then sq = Cells(1, 20).Resize(.Offset(1).SpecialCells(12).Count \ 2, 4)
sq(jj, 1) = cl.Offset(, 1)
sq(jj, 2) = ThisWorkbook.Sheets("Conversie Tool").Columns(11).Find(sq(jj, 1), , xlValues, xlWhole).Offset(, 1).Value
Else
sq(jj, 3) = cl.Offset(, 40).End(xlToLeft)
sq(jj, 4) = cl.Offset(, 40).End(xlToLeft).Offset(1)
jj = jj + 1
End If
Next
.AutoFilter
End With
End With
ThisWorkbook.Sheets("Conversie Tool").Cells(5, 3).Resize(UBound(sq), UBound(sq, 2)) = sq
End Sub
Bookmarks