#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 30
Default Search Macro

Is there a macro of function I can use to find key words or statements on a
worksheet, similat to the Find (goggles) icon?

Many thanks.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Search Macro

Try the below...If you are looking for a whole cell match; then change LookAt
to xlWhole

Sub Macro()

Dim varFound As Variant, varSearch As Variant

varSearch = InputBox("Find string")
Set varFound = Cells.Find(varSearch, LookIn:=xlValues, LookAt:=xlPart)
If Not varFound Is Nothing Then
varFound.Activate
End If

End Sub


--
Jacob (MVP - Excel)


"Eán" wrote:

Is there a macro of function I can use to find key words or statements on a
worksheet, similat to the Find (goggles) icon?

Many thanks.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 30
Default Search Macro - Command Button

How can I do this using the Command Button?

"Jacob Skaria" wrote:

Try the below...If you are looking for a whole cell match; then change LookAt
to xlWhole

Sub Macro()

Dim varFound As Variant, varSearch As Variant

varSearch = InputBox("Find string")
Set varFound = Cells.Find(varSearch, LookIn:=xlValues, LookAt:=xlPart)
If Not varFound Is Nothing Then
varFound.Activate
End If

End Sub


--
Jacob (MVP - Excel)


"Eán" wrote:

Is there a macro of function I can use to find key words or statements on a
worksheet, similat to the Find (goggles) icon?

Many thanks.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Search Macro - Command Button

--Set the Security level to low/medium in (Tools|Macro|Security).
--From workbook launch VBE using short-key Alt+F11.
--From menu 'Insert' a module and paste the below code.
--Get back to Workbook.

From menu ViewToolbarsForms drag a button control to the worksheet. and
select the macro to be assigned....

--
Jacob (MVP - Excel)


"Eán" wrote:

How can I do this using the Command Button?

"Jacob Skaria" wrote:

Try the below...If you are looking for a whole cell match; then change LookAt
to xlWhole

Sub Macro()

Dim varFound As Variant, varSearch As Variant

varSearch = InputBox("Find string")
Set varFound = Cells.Find(varSearch, LookIn:=xlValues, LookAt:=xlPart)
If Not varFound Is Nothing Then
varFound.Activate
End If

End Sub


--
Jacob (MVP - Excel)


"Eán" wrote:

Is there a macro of function I can use to find key words or statements on a
worksheet, similat to the Find (goggles) icon?

Many thanks.

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
Macro for Search Brigette Excel Discussion (Misc queries) 6 December 17th 09 04:44 PM
macro search puiuluipui Excel Discussion (Misc queries) 15 June 18th 08 02:13 PM
Search Macro Gary Excel Discussion (Misc queries) 1 March 29th 07 04:53 PM
Search In a Macro/VBA cbanks Excel Discussion (Misc queries) 2 May 4th 06 10:34 PM
search macro laprosa Excel Discussion (Misc queries) 0 November 26th 04 05:08 PM


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

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

About Us

"It's about Microsoft Excel"