#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 638
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
goto (F5) question dford Excel Discussion (Misc queries) 2 January 13th 07 04:54 AM
Goto code Bob Excel Discussion (Misc queries) 4 July 6th 06 05:44 PM
If.....Then GoTo....... Alec H Excel Discussion (Misc queries) 4 February 22nd 06 02:42 PM
Goto in IF statment =\ Excel Discussion (Misc queries) 3 August 14th 05 04:11 PM
Using 'GoTo' in a Macro adam777 Excel Discussion (Misc queries) 0 June 29th 05 09:16 PM


All times are GMT +1. The time now is 08:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"