I am getting a 'type mismatch error on the vlookup here but I don't understand why?
Code: Select all
Dim rng As Range, vlook As Range
Dim cnt As Integer
Dim fnd As String
Set vlook = Sheets("Bins").Range("M1:N17")
Set dstrg = dstws2.Range("C2:C" & dstlr)
For Each rng In dstrg
If rng.Offset(0, 1) = "" Then
rng.Offset(0, 1) = "'10"
rng.Offset(0, 1).Font.Bold = True
cnt = cnt + 1
End If
If Not rng.Offset(0, 1) = "10" And Not Right(rng, 1) = "E" Then
fnd = Application.VLookup(Left(rng, 6), vlook, 2, False)
If IsError(fnd) Then
rng.Offset(0, 1) = "'10"
rng.Offset(0, 1).Font.Bold = True
cnt = cnt + 1
End If
End If
Next rng