Fine
Hi donald,
I prepared and answer and I now see someone else has answered. However, I'll
post my code anyway because it is a variation on the other answer. This code
cuts the number from the original location and inserts it at the top. It also
allows you to continue your searches until you click cancel.
Sub Macro1()
Dim inputNumber As Variant
Dim foundCell As Range
Do
inputNumber = InputBox("Enter the number to be found" & _
Chr(13) & "Cancel to exit")
With Sheets("Sheet1").Columns("A")
Set foundCell = .Find(What:=inputNumber, _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)
If foundCell.Value < "" Then
foundCell.Cut
.Cells(1, 1).Insert Shift:=xlDown
End If
End With
Loop While inputNumber < ""
End Sub
Regards,
OssieMac
|