hi
I got this code from this forum but it gives error type mismatch in this line
my numbers in COL B 2722,2723,2725 the result should be 2721,2724 in COL G when show the result . it should start after 0
I got this code from this forum but it gives error type mismatch in this line
VBA Code:
StartV = Range("b2")
Code:
Sub MissingValues()
Dim rng As Range, j As Variant
Dim StartV As Long, EndV As Long, i As Long
Dim k() As Long, Last_Row As Long
Last_Row = Range("B5000").End(xlUp).Row
ReDim k(0)
Set rng = Range("B2:B" & Last_Row)
StartV = Range("B2")
EndV = Range("B" & Last_Row)
For i = StartV To EndV
On Error Resume Next
j = Application.Match(i, rng, 0)
If IsError(j) Then
k(UBound(k)) = i
ReDim Preserve k(UBound(k) + 1)
End If
Next i
Range("G1") = "Missing values"
Range("G2:G" & UBound(k) + 1) = Application.Transpose(k)
End Sub
I hope to find help who has knowledge in vba