Ever wondered how to make Excel speak text out loud? Well I was reading some cool posts on Ozgrid before Christmas and came across this bit of fun. It is a tool which allows you to have a bit of a laugh with your work mates. Enter your phrase in the cell provided and click the button next to it. Whatever you type in the cells will be spoken in a computerised voice. The following is the gold to make it happen.
Dim txt As String
txt = [D11]
The cell D11 contains the text you wish spoken out loud. The code should run when you press the button on the sheet.
If you wish the code to run a bit more autonomously then add the code to a worksheet event. The event could be if a particular group of cells is clicked on. To make things easier I will name the cells D11 - 'Talk'. The following would be put in the worksheet module where the code is to be run from.
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("Talk")) Is Nothing Then TalktoMe
Or it could be when the worksheet is clicked on.
Private Sub Worksheet_Activate()
The following is an example file with two sheets which work on the premise above.