Identify product not found

  • Thread starter Thread starter Pat
  • Start date Start date
P

Pat

Is there a way to identify what cell that does not have a product in so that
an error message can be acted upon. The following (part of) code is
returning "Product not found 0" when there does not appear to be a product
missing.

For Each Target In rng1
sProd = Target.Parent.Cells(Target.Row, 17)

res = Application.Match(sProd, _
Worksheets("CC").Range("C31:C1000"), 0)
If Not IsError(res) Then
With Worksheets("CC")
If IsNumeric(Target.Value) Then
Set rng2 = .Cells(res + 30, icol)
rng2.Value = rng2.Value + Target.Value
End If
End With

Much appreciate it if you can be of help.
Pat
 
Back
Top