Identify product not found

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top