VBA - Text to Speech

Status
Not open for further replies.

mem_dawg

New Member
Joined
Oct 30, 2011
Messages
38
Hi All,

My version is 2007.

I'm getting news headers from a web site using the "import data from a web page"

Cell A1 is the header of Number 1 news in that source web site.

What I want is; Excel to read it to me when this Cell A1 updates itself and changes.

I've seen a similar thread here and tried this VBA:

***********************************************

Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Range, c As Range, ir As Range
Set r = Range("A1")
Set ir = Application.Intersect(Target, r)
If ir Is Nothing Then Exit Sub
For Each c In Range("A1")
c.Speak
Next c
End Sub

***********************************************

I've saved the file as Excel Macro-Enabled Workbook and enabled macros but not doing anything.. Do I have to do anything else like compiling or activating the macro or something else? Or is the code wrong? As you can see I'm not familiar with VBA or Macros..

Any idea??

Thanks in advance..

cheers,
mem
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hello

Welcome to MrExcel.

This works fine for me:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address = "$A$1" Then Target.Speak
End Sub

So you can indeed cut down on your codes used.

Does this work if you manually type a word in cell A1? (for instance: type the word Manchester)

Did you put the code in the correct sheet code module?
 
Upvote 0
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address = "$A$1" Then Target.Speak
End Sub

Hi Wigi,

Thanks for the reply, now at least it reads it when i change the cell content manually, but it doesn't read it if the cell changes itself automatically with Web Import function.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,216,748
Messages
6,132,492
Members
449,730
Latest member
SeanHT

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