#1   Report Post  
Posted to microsoft.public.excel.misc
SubliminalJones
 
Posts: n/a
Default search by keyword


Hello and "Happy Days off for Celebrating Something...or not".

I was trying to make a macro that would allow me to type a word in A1,
and touch an object to do a keyword search based on A1.

Can I do that?


Thanks all!!

SJ.


--
SubliminalJones
------------------------------------------------------------------------
SubliminalJones's Profile: http://www.excelforum.com/member.php...o&userid=27597
View this thread: http://www.excelforum.com/showthread...hreadid=496293

  #2   Report Post  
Posted to microsoft.public.excel.misc
Norman Jones
 
Posts: n/a
Default search by keyword

Hi Subliminal,

Try assigning the following code to a button::

'=============
Public Sub Tester001()
Dim rng As Range
Dim rngFound As Range
Dim sStr As String

Set rng = Range("A1")
sStr = rng.Value

Set rngFound = Cells.Find(What:=sStr, _
After:=Selection, _
LookIn:=xlValues, _
LookAt:=xlPart, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlNext)

If rngFound.Address = rng.Address Then
Set rngFound = Cells.FindNext(rngFound)
End If

rngFound.Activate

End Sub
'<<=============

If you were unsure of the required syntax, you would find the macro recorder
an invaluable tool.


---
Regards,
Norman


"SubliminalJones"
<SubliminalJones.20q0ps_1135724107.7898@excelfor um-nospam.com wrote in
message news:SubliminalJones.20q0ps_1135724107.7898@excelf orum-nospam.com...

Hello and "Happy Days off for Celebrating Something...or not".

I was trying to make a macro that would allow me to type a word in A1,
and touch an object to do a keyword search based on A1.

Can I do that?


Thanks all!!

SJ.


--
SubliminalJones
------------------------------------------------------------------------
SubliminalJones's Profile:
http://www.excelforum.com/member.php...o&userid=27597
View this thread: http://www.excelforum.com/showthread...hreadid=496293



  #3   Report Post  
Posted to microsoft.public.excel.misc
SubliminalJones
 
Posts: n/a
Default search by keyword


Hi Norman,

Thanks for the help. It works good but it gives an error message that
highlights

Set rngFound = Cells.Find(What:=sStr, _
After:=Selection, _
LookIn:=xlValues, _
LookAt:=xlPart, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlNext)

in the debugger. It appears to have a problem with

SearchDirection:=xlNext)

Any suggestions?

Thanks again, SJ


--
SubliminalJones
------------------------------------------------------------------------
SubliminalJones's Profile: http://www.excelforum.com/member.php...o&userid=27597
View this thread: http://www.excelforum.com/showthread...hreadid=496293

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
How do I search excel spreadsheets using multiple search criteria. Kasper Excel Worksheet Functions 4 December 15th 05 12:26 AM
Search Entire Workbook Sloth Excel Discussion (Misc queries) 0 October 14th 05 05:12 AM
Search within workbook Mare New Users to Excel 3 October 10th 05 07:17 PM
Wildcard search functions within Vlookup Benn Excel Worksheet Functions 2 July 26th 05 01:12 PM
FAQ Spreadsheet with search function murphyz Excel Discussion (Misc queries) 0 March 19th 05 09:24 PM


All times are GMT +1. The time now is 09:01 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"