View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
GS[_6_] GS[_6_] is offline
external usenet poster
 
Posts: 1,182
Default Input box, find number and go to cell

Try...

Sub FindNumber()
Dim NumToFind, rng As Range

NumToFind = Application.InputBox("Enter the number to find", Type:=1)
If NumToFind = False Then Beep: Exit Sub

Set rng = Range("A:A").Find(NumToFind, LookIn:=xlValues)
If rng Is Nothing Then
MsgBox "The number was not found"
Else
ActiveWindow.ScrollRow = rng.Row
End If
End Sub

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion