Browse » Home
Thursday, April 18, 2013
How to Use the Find the Method in Excel 2003 Using Visual Basic
1. Launch Excel 2003.
2. Open the 'File' menu at the top of the screen and click 'Open.' Double-click the spreadsheet that needs to use the 'Find' method.
3. Click the 'Tools' menu at the top of the window and scroll down to the 'Macro' entry. Click the 'Visual Basic Editor' entry in the sub-menu.
4. Click the name of the worksheet you need to use in the list of worksheets at the left side of the screen. Click inside the code editor screen at the left side of the window.
5. Type the phrase 'Sub Finding()' at the top of the screen to let the Visual Basic editor know where the code should begin. The word 'Finding' can be replaced with anything you'd like, such as 'Sub MyFindCode()' or something similar. Tap 'Enter' twice and type 'End Sub' to let the editor know where your code ends.
6. Move the cursor in between the 'Sub' and 'End Sub' headings. Type 'Cells.Find().Activate' to tell the editor to use the 'Find' method. Move the cursor inside the '()' portion of the 'Find' method and use the 'What' argument to indicate what you are looking for. For example, the code should read 'Cell.Find(What:='555').Activate' if you want to find a cell containing the numbers '555.'
7. Fill in the remaining arguments for the 'Find' method to let the editor know to search the entire worksheet for the specified numbers or letters. For example, if you want to search for '555,' your entire line of code should read 'Cells.Find(What:='555', After:=ActiveCell, LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False).Activate.'
8. Click the green arrow icon labeled 'Run' at the top of the screen to use the 'Find' method and locate the cell containing the numbers or letters.