VBA: Upon cell selecion use Speech.Speak

bamaisgreat

Well-known Member
Joined
Jan 23, 2012
Messages
821
Office Version
  1. 365
Platform
  1. Windows
My goal here is to have it were when someone clicks say A4 the code below is executed:
Code:
Application.Speech.Speak "Enter your full name"
I will have several different cells and have it saying several different things.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Try like this in the sheet's code module. You can expand the Case statement to add other cells

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
Select Case Target.Address(False, False)
    Case "A4": Application.Speech.Speak "Enter your full name"
End Select
End Sub
 
Upvote 0
Peter how do I go about making this speak in Spanish and English. Thanks as always
 
Upvote 0
I cannot find a method to do this other than

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
Select Case Target.Address(False, False)
    Case "A4": Application.Speech.Speak "Enter your full name": Application.Speech.Speak "Ingrese su nombre completo"
End Select
End Sub

Maybe somebody who has more knowledge of the speech engine knows?
 
Upvote 0
I think im going to use the code in a User Form. Could you show me how the code would need to look ? I will be using it on text boxes and combo boxes. Thanks
 
Upvote 0
Something like this should work

Code:
Application.Speech.Speak UserForm1.textbox1.Value
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,739
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top