Article ID: 111942 - View products that this article applies to.
This article was previously published under Q111942
In Microsoft Excel, if you choose Replace from the Edit menu, and you leave the Find What box blank and choose Find Next, Replace, or Replace All to fill blank cells on a worksheet, you receive the following error message:
Search string must be specified
To work around this problem, use any of the following methods.
Method 1: The following method is presented on page 33 in "Microsoft Excel Visual Basic for Applications Step by Step," a Microsoft Press book.
The following Visual Basic procedure prompts you for the text you want to enter in blank cells, and replaces the contents of the blank cells in the selection with this text.Microsoft provides examples of Visual Basic for Applications procedures for illustration only, without warranty either expressed or implied, including, but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. The Visual Basic procedures in this article are provided 'as is' and Microsoft does not guarantee that they can be used in all situations. While Microsoft support professionals can help explain the functionality of a particular macro, they will not modify these examples to provide added functionality, nor will they help you construct macros to meet your specific needs. If you have limited programming experience, you may want to consult one of the Microsoft Solution Providers. Solution Providers offer a wide range of fee-based services, including creating custom macros. For more information about Microsoft Solution Providers, call Microsoft Customer Information Service at (800) 426-9400.
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in Microsoft Excel for Windows version 5.0c.
In Microsoft Excel versions earlier than version 5.0, you can replace blank cells with a value by using the Replace dialog box and leaving the Find What box blank. However, in Microsoft Excel version 5.0, you cannot use this method to replace blank cells because you cannot leave the Find What box in the Replace dialog box blank.
"Microsoft Excel Visual Basic for Applications Step by Step," Reed Jacobson, ISBN is 1-55615-589-1
Article ID: 111942 - Last Review: October 11, 2006 - Revision: 1.3
Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.