A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

SEARCH BOX



 
 
Thread Tools Display Modes
  #1  
Old March 27th, 2010, 03:13 AM posted to microsoft.public.excel.newusers
John
external usenet poster
 
Posts: 2,649
Default SEARCH BOX

First thank you in advance for any help. I want to put a search box on the
first sheet of my program to enter data, either a name or an assigned number,
and have it search for and go to that line of information on another sheet.
Can I do this or do you have another suggestion?
  #2  
Old March 27th, 2010, 02:11 PM posted to microsoft.public.excel.newusers
Don Guillett[_2_]
external usenet poster
 
Posts: 607
Default SEARCH BOX

This should do it. Change sheet name and column numbers to suit

Sub nameornumberfind()
With Sheets("sheet34")
mv = InputBox("Enter name or number")
If IsNumeric(mv) Then
'MsgBox "number"
mc = 4
Else
'MsgBox "text"
mc = 1
End If
Set mf = .Columns(mc).find(What:=mv, LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False)

If Not mf Is Nothing Then
'MsgBox "found at " & mf.Row
Application.Goto .Cells(mf.Row, mc)
End If
End With
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"JOHN" wrote in message
...
First thank you in advance for any help. I want to put a search box on the
first sheet of my program to enter data, either a name or an assigned
number,
and have it search for and go to that line of information on another
sheet.
Can I do this or do you have another suggestion?


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


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


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