ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Search and Goto (https://www.excelbanter.com/excel-discussion-misc-queries/159973-search-goto.html)

Dgwood90

Search and Goto
 
I need to create a formular or macro that when a number is typed, it will
take you to the cell. I know about the find feature, but if there is a way to
search and goto, that would be preferable.

JW[_2_]

Search and Goto
 
On Sep 27, 7:14 pm, Dgwood90
wrote:
I need to create a formular or macro that when a number is typed, it will
take you to the cell. I know about the find feature, but if there is a way to
search and goto, that would be preferable.


OK is clicked, it will locate the first occurrence of that value in
the active worksheet.
Sub findMe()
Dim nput As String, found As Range
nput = InputBox("Enter what to find")
If nput < "" Then
Set found = Cells.Find(What:=nput, After:=Cells(1, 1), _
LookIn:=xlValues, LookAt:=xlWhole, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
If Not found Is Nothing Then
Range(found.Address).Activate
Else
MsgBox nput & " not found"
End If
End If
End Sub



All times are GMT +1. The time now is 12:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com