CheckSpelling Method

Applies To

Application object, Chart object, Range object, Worksheet object.

Description

Syntax 1: Checks the spelling of an object. This form has no return value; Microsoft Excel displays the Spelling dialog box.

Syntax 2: Checks the spelling of a single word. Returns True if the word is found in one of the dictionaries, False if it isn't.

Syntax 1

expression.CheckSpelling(CustomDictionary, IgnoreUppercase, AlwaysSuggest, IgnoreInitialAlefHamza, IgnoreFinalYaa, SpellScript)

Syntax 2

expression.CheckSpelling(Word, CustomDictionary, IgnoreUppercase)

expression Required. An expression that returns an object in the Applies To list. Use the Application object to check a single word (Syntax 2).

CustomDictionary Optional Variant. A string that indicates the file name of the custom dictionary to examine if the word isn't found in the main dictionary. If this argument is omitted, the currently specified dictionary is used.

IgnoreUppercase Optional Variant. True to have Microsoft Excel ignore words that are all uppercase. False to have Microsoft Excel check words that are all uppercase. If this argument is omitted, the current setting will be used.

AlwaysSuggest Optional Variant. True to have Microsoft Excel display a list of suggested alternate spellings when an incorrect spelling is found. False to have Microsoft Excel wait for you to input the correct spelling. If this argument is omitted, the current setting will be used.

Word Required String (used with Application object only). The word you want to check.

IgnoreInitialAlefHamza Optional Variant. Not used in U.S./English Microsoft Excel.

IgnoreFinalYaa Optional Variant. Not used in U.S./English Microsoft Excel.

SpellScript Optional Variant. Not used in U.S./English Microsoft Excel.

Remarks

To check headers, footers, and objects on a worksheet, use this method on a Worksheet object.

To check only cells and notes, use this method with the object returned by the Cells method.

Example

This example checks the spelling on Sheet1.

Worksheets("Sheet1").CheckSpelling