Automatic text to speech when cell changes?

Generic

Board Regular
Joined
Dec 6, 2006
Messages
64
Is there a way to have excel speak a cell when it changes?

I have a sheet perform data imports from a website on the hour, I watch selected data on another page (Main Page) for any changes. I have found a macro that when run will read a selected cell and say it via the speech system. Is there a way to have excel automatically read aloud the cell when the data changes in response to an automatic web query?
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
We came up with a recent similar requirement today (assume that A1 is the cell which has the changing values):

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(False, False) = "A1" Then
    Application.EnableEvents = False
    '//Run your speech macro here
    Application.EnableEvents = True
End If
End Sub

Maybe that will give you enough ideas to get it going? This is "sheet code" so it goes in the sheet module (right click on the sheet tab to display its code window).

On code placement:
http://www.mcgimpsey.com/excel/modules.html

The thread referred to above:
http://www.mrexcel.com/forum/showthread.php?t=375979&page=2

HTH,
Alex
 
Upvote 0
If you are on a mac
Code:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    If Target.Cells.Count = 1 Then
        On Error Resume Next
            MacScript ("say " & Chr(34) & Target.Text & Chr(34))
        On Error GoTo 0
    End If
End Sub
 
Upvote 0
I am not sure how to place or run the macro in your script. Yup, I am a noob.

EDIT: I am using Office 2007 on Windows 7

The macro for speech I found on this site:
----------------------------------------
Sub TellMe()
Application.Speech.Speak Range("C4")
End Sub

Your Script:
-----------
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(False, False) = "A1" Then
Application.EnableEvents = False
'//Run your speech macro here
Application.EnableEvents = True
End If
End Sub
 
Last edited:
Upvote 0
Got it.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(False, False) = "C4" Then
Application.EnableEvents = False
Application.Speech.Speak Range("C4")
Application.EnableEvents = True
End If
End Sub
 
Upvote 0
Thought I had it.

Seems that this will run the macro when the workbook is open but will not sound the speech when the data is changed in response to an automatic web query. It will work though if I change the data in the cell manually.
 
Upvote 0

Forum statistics

Threads
1,214,524
Messages
6,120,049
Members
448,940
Latest member
mdusw

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