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

Setting Default Attributes for Lines and Arrows

Don't like the way that Excel formats lines and arrows? You can easily make your own formatting changes, and then use your ...

Discover More

Hiding and Displaying Hidden Text

You can easily hide text by simply changing the attributes associated with the text. Once that is done, you can turn the ...

Discover More

Rejecting Changes in a Document

When a group of people edits a document with Track Changes turned on, it can be tempting for one of the editors to use the ...

Discover More

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!

More ExcelTips (menu)

Searching for Leading Apostrophes

Take a look at the Formula bar when you select a cell that contains text, and you may see an apostrophe at the beginning of ...

Discover More

Wildcards in 'Replace With' Text

When doing searches in Excel, you can use wildcard characters in the specification of what you are searching. However, you ...

Discover More

Making All Occurrences Bold

Want to make instances of a given word or phrase bold throughout a worksheet? Here's a way you can make the change quickly.

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 6Mpixels. 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 seven less than 7?

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.