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: Extracting Proper Words.
by Allen Wyatt
(last updated June 25, 2018)
Vanita has a worksheet that contains different combinations of letters in each cell of column A. He is looking for a way to extract the words from that list that are "proper," meaning that they are found in a spell-check dictionary.
Assuming that the column contains only words (no spaces, punctuation, or phrases), you can manually check the list in this manner:
If you need to perform the validation process regularly, you may want to use a macro to instead create your final list. The following macro steps through the word list in column A and clears any cells that contain words not in the dictionary. After checking all the words, it then deletes all the cleared cells.
Sub ExtractDictionaryWords() Dim rWords As Range Dim rCell As Range Application.ScreenUpdating = False Set rWords = Range(Range("A1"), _ Range("A65536").End(xlUp)) For Each rCell In rWords If Not Application.CheckSpelling(rCell.Value) Then rCell.Clear End If Next On Error Resume Next rWords.SpecialCells(xlCellTypeBlanks). _ Delete (xlShiftUp) On Error GoTo 0 Set rCell = Nothing Set rWords = Nothing Application.ScreenUpdating = True End Sub
Remember—this macro is intentionally destructive in its behavior, meaning that it clears out cells. If you have any need for the original data, you'll want to run the macro on a copy of the data, not on your only copy.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2834) 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: Extracting Proper Words.
Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!
One of the automatic macros you can set up in Excel is one that is triggered when a workbook is closed. This tip explains ...Discover More
If you need to know whether a particular value is odd or even, you can use this simple formula. Designed to be used in a ...Discover More
Addresses used in a formula can be either relative or absolute. If you need to switch between the two types of ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
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.