Good Morning,
The procedure below tests the value in a cell against the first two cells to the left in the same row. If the condition is true a three letter code is copied into column A. Some of the cells in the column contain either #DIV/0! Or #VALUE! the On Error statement is designed to handle this and works until the last cell containing either #DIV/0! Or #VALUE!. The procedure then produces a Run Time error.
Please will someone show me where I am going wrong.
Sub Loop_test()
Do Until IsEmpty(ActiveCell)
On Error GoTo BadEntry
If Selection.Value > 0 And Selection.Offset(0, -1).Value > 0 And Selection.Offset(0, -2).Value > 0 _
And Selection.Value > Selection.Offset(0, -1).Value And Selection.Offset(0, -1).Value > _
Selection.Offset(0, -2).Value Then _
Range("J" & ActiveCell.Row).Copy Range("a:a").Cells(Rows.Count).End(xlUp).Offset(1, 0)
Selection.Offset(1, 0).Select
BadEntry:
Selection.Offset(1, 0).Select
Loop
End Sub
Sorry about not wrapping the code but I seemed to be unable yo get the code taqgs to work.
Rob.
Sorry about not wrapping the code but I seemed to be unable yo get the code taqgs to work.
Rob.