Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.
With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company.
Learn more about Allen...
A few issues ago a tip appeared about how to display the Find and Replace box and set the Within drop-down list to Sheet. At the time I reported that I had not come across a way to actually accomplish this, as VBA didn't provide a way to display the same Find and Replace dialog box that appears when you press Ctrl+F.
This past week I found out the way to do this, thanks to the contribution of a generous ExcelTips subscriber. The following macro shows how to accomplish the task:
Sub DoBox() ActiveSheet.Cells.Find What:="", LookAt:=xlWhole Application.CommandBars("Worksheet Menu Bar").FindControl( _ ID:=1849, recursive:=True).Execute End Sub
The Find method allows you to set the different parameters in the Find and Replace dialog, and then the CommandBars object is accessed to actually display the dialog box.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2486) applies to Microsoft Excel 97, 2000, 2002, and 2003.
Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!