meridius10
New Member
- Joined
- Apr 30, 2011
- Messages
- 47
I am looking to make amendments to the following code so that it will find multiple duplicate numbers, similar to FindAll, and then move from one number to the next.
So for example if the number '201' appears twice this is reported, or preferably moves in sequence down twice.
So for example if the number '201' appears twice this is reported, or preferably moves in sequence down twice.
Code:
Sub findobjectnumber()
On Error GoTo z
Dim x As Integer
Dim y As Range
Set y = Range("A:A")
Set w = Range("A2")
w.Select
x = InputBox("Enter the object number below")
y.Find(What:=x, _
After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlWhole, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate
Exit Sub
z:
MsgBox ("Object number does not exist. Try again.")
End Sub