Macro that can take a value entered by a User and search for it w/in spreadsheet
Posted by Rob Miller on October 24, 2000 2:48 PM
I am admittedly a beginner here with VBA and Macros. I am trying to run a macro that will allow a user of a spreadsheet to enter a keyword in a specific cell (say B3) and then have the macro automatically pick up that keyword entered and search for it w/in the data of a specific worksheet.
I recorded a simple macro where I highlight cell B3 and then enter any given word into that cell and then run a "find" off the Edit menu. How can I take that a step further and have the macro search for the keyword the user enters and then highlight that row and/or keyword w/in the body of the spreadsheet?
Here is the sample code from the macro.. what can be done to change this to accomplish the above task?:
' TEST Macro
' Macro recorded 10/24/2000 by RMiller
Application.CutCopyMode = False
Cells.Find What,=Range("B3").Value, After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
Perhaps there is a completely different, more efficient way of accomplishing this?