Do you know about those kids toys that spells out the name of an object and then says the word? Well, you can do the same thing in Excel. This article is about the use of Speech.Speak in VBA, and this process provides a good demonstration of its use. Place this event procedure in a Worksheet module.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
textInCell = Target.Value
If textInCell = “” Then Exit Sub
For n = 1 To Len(textInCell)
If Asc(Mid(textInCell, n, 1)) > 64 And Asc(Mid(textInCell, n, 1)) < 91 Then
Application.Speech.Speak “Capital ” & Mid(textInCell, n, 1)
Else
Application.Speech.Speak Mid(textInCell, n, 1)
End If
Next
Application.Speech.Speak (“spells ” & textInCell)
End Sub
Then, select a cell on the worksheet and if it contains a word it will spell the word and then say it. In the example file, A1 contains the word “Elephant”. If that cell is selected, it will be spelled out starting with “capital E” followed by the rest of the letters and then says “spells Elephant”.
You can download the file here. It also contains a greeting upon opening the workbook.