Phonetics.Add method (Excel)
Adds phonetic text to the specified cell.
Syntax
expression.Add (Start, Length, Text)
expression A variable that represents a Phonetics object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
Start | Required | Long | The position that represents the first character in the specified cell. |
Length | Required | Long | The number of characters from the Start position to the end of the text in the cell. |
Text | Required | String | Collectively, the characters that represent the phonetic text in the cell. |
Example
This example adds three phonetic text strings to the active cell. The example then sets the character type to Hiragana, sets the font color to blue, and sets the text to visible.
ActiveCell.FormulaR1C1 = "東京都渋谷区代々木"
ActiveCell.Phonetics.Add Start:=1, Length:=3, Text:="トウキョウト"
ActiveCell.Phonetics.Add Start:=4, Length:=3, Text:="シブヤク"
ActiveCell.Phonetics.CharacterType = xlHiragana
ActiveCell.Phonetics.Font.Color = vbBlue
ActiveCell.Phonetics.Visible = True
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.