Written by Allen Wyatt (last updated December 31, 2019)
This tip applies to Excel 97, 2000, 2002, and 2003
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 box, and then the CommandBars object is accessed to actually display the dialog box.
Note:
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2486) applies to Microsoft Excel 97, 2000, 2002, and 2003.
Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!
The Track Changes tool in Excel can be helpful, but it can also be aggravating because it doesn't allow you to use it on ...
Discover MoreAfter creating different views of your worksheet data, you can display those views by simply selecting which one you want ...
Discover MoreCombo boxes can be a great way of getting user input in a worksheet. Here's how to add a combo box to your worksheet and ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)
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.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments