P
Pat
Is there a way to find a cell(s) that causes an error when code is run. The
following code returns 'Product not found: 0' error. I have looked up and
down but cannot find the offending 3 cells.
For Each Target In rng1
sProd = Target.Parent.Cells(Target.Row, 18)
res = Application.Match(sProd, _
Worksheets("ControlCentre").Range("C77:C1000"), 0)
If Not IsError(res) Then
With Worksheets("ControlCentre")
' Will return quantity 'Back into stock'
If IsNumeric(Target.Value) Then
Set rng2 = .Cells(res + 76, icol)
rng2.Value = rng2.Value + Target.Value
End If
End With
Else
MsgBox "Product Not found: " & sProd
End If
Next
following code returns 'Product not found: 0' error. I have looked up and
down but cannot find the offending 3 cells.
For Each Target In rng1
sProd = Target.Parent.Cells(Target.Row, 18)
res = Application.Match(sProd, _
Worksheets("ControlCentre").Range("C77:C1000"), 0)
If Not IsError(res) Then
With Worksheets("ControlCentre")
' Will return quantity 'Back into stock'
If IsNumeric(Target.Value) Then
Set rng2 = .Cells(res + 76, icol)
rng2.Value = rng2.Value + Target.Value
End If
End With
Else
MsgBox "Product Not found: " & sProd
End If
Next