Can Excel's speech be made to read cell contents instead of macro placed text?

M

mrlanier

Can someone write a macro that will read string text results from a
designated cell (A1) instead of having to rely on macro dictated text
such as in the sample below?

Private Sub Worksheet_Calculate()
With Application.Speech
Select Case Range("A1")
Case Is = 1: .Speak "If A1 has a returned value of 1, then
this text is made audible."
Case Is = 2: .Speak "If A1 has a value of 2, then this text is
spoken by the computer."
End Select
End With
End Sub
 
M

mrlanier

Thank you Tim. Unfortunately, I'm not very proficient with macros.
I'm not sure how you intend your suggestion to be placed, assuming you
intended to place it within my current macro. Can you be more
specific? Thanks.

application.Speech.Speak activesheet.range("C2").value

Private Sub Worksheet_Calculate()
With Application.Speech
Select Case Range("A1")
Case Is = 1: .Speak "If A1 has a returned value of 1, then
this text is made audible."
Case Is = 2: .Speak "If A1 has a value of 2, then this text is
spoken by the computer."
End Select
End With
End Sub- Hide quoted text -
 
T

Tim

Private Sub Worksheet_Calculate()
With Application.Speech
Select Case Range("A1")
Case Is = 1: .Speak
ThisWorkbook.Sheets("Speech").Range("A1").value
Case Is = 2: .Speak
ThisWorkbook.Sheets("Speech").Range("A2").value
End Select
End With
End Sub

Tim
 
T

Tim Williams

Note those "Case..." lines should be on one line: got wrapped when I posted.

Tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top