Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, and 2016. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Extracting Proper Words.
by Allen Wyatt
(last updated November 19, 2020)
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("A1048576").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 (11284) applies to Microsoft Excel 2007, 2010, 2013, and 2016. You can find a version of this tip for the older menu interface of Excel here: Extracting Proper Words.
Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!
The security features built into Excel allow you to digitally sign your macros so that users can rest assured that they ...Discover More
If you have a series of values in a column, you might have a need to separate the values into even values and odd values. ...Discover More
Unprotecting a single worksheet is relatively easy. Unprotecting a whole lot of worksheets is harder. Here's how you can ...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 ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.