Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Searching for Wildcards.

Searching for Wildcards

by Allen Wyatt
(last updated July 27, 2013)

4

You know that you can use Excel's Find and Replace feature to locate information in your workbooks. (Just press Ctrl+F or Ctrl+H to pull up the dialog box.) You may even know that you can use question marks (?) and asterisks (*) as wildcard characters, just as you would at a DOS command prompt. What if you want to search for a cell that actually contains an asterisk or a question mark, however?

Excel allows you to search for special characters by preceding the character with the tilde (~). In other words, if you want to search for an asterisk, you would actually search for ~*. If you wanted to search for the question mark, you would search for ~? instead.

Finally, if you wanted to search for the tilde character, you would actually search for ~~. In each instance, the leading tilde informs Excel that the following character should be translated as an actual character, and not as a special wildcard character.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2333) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Searching for Wildcards.

Author Bio

Allen Wyatt

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. ...

MORE FROM ALLEN

Defining a Shortcut for a Macro

You can make running macros very easy if you assign a shortcut key to the macro. This tip demonstrates how easy it is to ...

Discover More

Resizing a Text Box in a Macro

Text boxes are easy to add to a document and manually resize, as needed. If you want to resize the text box in a macro, ...

Discover More

Number of Terms in a Formula

Formulas are made up of operands that separate a series of terms acted upon by the operands. You may want to know, for some ...

Discover More

Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!

More ExcelTips (menu)

Checking for Messages in Cells

If you have a range of cells used to display error messages, you soon discover that it is easy to miss messages that may ...

Discover More

Searching Through Many Workbooks

If you have a folder that contains dozens or hundreds of workbooks, you may need to search through those workbooks to find ...

Discover More

Limitations On Finding Characters

When you search for information in a worksheet, you expect Excel to return results that make sense. If you don't get a search ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 8Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 7 - 2?

2015-10-15 13:45:48

Adalberto

YongBoo,

You can try a macro for search and replace (or remove) any cell containning chars with ascii value greater than, for example, 167.

Public Function cuttrash(r As Range)
lr = Len(r.Value)
For c = 1 To lr
at = Asc(Mid$(r.Value, c, 1))
If at > 165 Then
cuttrash = ""
Exit Function
End If
Next
cuttrash = r.Value
End Function


2014-11-24 12:47:30

Jiehan

In response to yongboo:

Find ~*, and replace with nothing.


2014-08-16 09:22:29

PhilP

@ yongboo

Ctrl-H to Find & Replace.

In Find What box enter ~*???? (with ? for each character after * you wish to remove - if you put more than you need then no problem)

Leave Replace With box empty

Hit Replace ALL


2014-08-15 14:16:12

yongboo

I'm a teacher working on some language data on Excel. I'm trying to remove every occurrence of texts followed by '*'. For example, I have multiple cells that are like this.

출연하다
*나오다

So I'm trying to get rid of '*나오다' from this particular cell, and other cells that have a similar combination. But the actual texts after '*' are different from cell to cell.

How do I do that?
Thank you so very much for any help!!


This Site

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.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.