View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.newusers
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Text to speech particular cell

You cannot replicate the subs. There can only be one sub of each type on
each worksheet/workbook.

You would need to use arrays within the subs to trap the different cells
that must be monitored.
--
Gary''s Student - gsnu200817


"FunkyAnt13" wrote:

Thank you very much
Just a further question, if i wanted to add more cells how could i do that?
im thinking of being crude and just using the same code repeatedly, changing
the cell.
However ive tried that, but i know im not doing it right, i dont know if i
have to do it in the same worksheet or not, and if so then how do i avoid the
"ambiguous name detected" error.

As you can tell im very new to VBA

Once again, thanks for any help
"Gary''s Student" wrote:

Let's put the message in a cell, say D16.

In a standard module insert the follow line:
Public OldVar As Variant

Insert the following event macro in the worksheet code area:

Private Sub Worksheet_Calculate()
If OldVar = Range("B15").Value Then Exit Sub
Range("B16").Speak
OldVar = Range("B15").Value
End Sub


Insert the following macro in the workbook code area:

Private Sub Workbook_Open()
OldVar = Sheets("Sheet1").Range("B15").Value
End Sub


--
Gary''s Student - gsnu200817