Excel.Tips.Net Welcome toExcel.Tips.Net

Helpful Links

Tips.Net Home
ExcelTips Home
Ask an Excel Question
Make a Comment

Tips.Net Store

ExcelTips FAQ
ExcelTips Premium

Learn Access Now
Free Printable Forms

Beauty Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Legal Tips
Money Tips
Organizing Tips
Pest Tips
Pet Tips
Wedding Tips
Word2007 Tips
WordTips

Advertise on the
ExcelTips Site

Newest Tips

Recording a Macro

Adding a Little Animation to Your Life

Converting a Range of URLs to Hyperlinks

Making the Formula Bar Persistent

Engineering Calculations

Digital Signatures for Macros

Fixing the Decimal Point

 

Searching a Workbook by Default

Summary: When you display the Find tab of the Find and Replace dialog box, you'll notice that any search, by default, will be on the current worksheet. If you want Excel to default to searching the entire workbook, you may be out of luck. (This tip works with Microsoft Excel 97, Excel 2000, Excel 2002, Excel 2003, and Excel 2007.)

When you display the Find tab of the Find and Replace dialog box (pressing Ctrl+F is the easiest way), Excel makes certain assumptions about what exactly you want to search. What you want to search is dictated by the setting of the Within drop-down list. When you first display the Find and Replace dialog, Within is set to Sheet, by default. (Click here to see a related figure.) This setting is true regardless of whether you select one worksheet or multiple worksheets prior to displaying the dialog box.

If you want the Within drop-down list to default to Workbook (instead of Sheet), there is no way to specify this in Excel. You can take some solace in the fact that the setting of the Within drop-down list is persistent for the current session with Excel. In other words, if you set it to Workbook, complete your search, and later display the Find tab of the Find and Replace dialog, box then Within is still set to Workbook.

It is interesting that there appears to be no way tackle this issue using a macro, either. This is because Excel doesn't provide a way for a macro to display and modify the settings in the Find and Replace dialog box. Many dialog boxes can be displayed, but not the Find and Replace. Instead, VBA allows you to display an older version of the Find dialog box (Click here to see a related figure.) , using this code:

Sub ShowFind()
    Application.Dialogs(xlDialogFormulaFind).Show
End Sub

Unfortunately, this version of the Find dialog box does not have a control that allows you to specify the scope of the search, as can be done with the Within drop-down list in the Find tab of the Find and Replace dialog box.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (3170) applies to Microsoft Excel versions: 97 | 2000 | 2002 | 2003 | 2007

Save Time and Money! Many people need to keep track of employee time, but don't know where to start when it comes to creating a spreadsheet. Here's a way to save time, effort, and money with ready-to-use timesheet templates.
 
Check out Timesheet Templates today!