BLOGS BY TOPIC▼
BLOGS BY AUTHOR▼
BLOGS BY YEAR▼
Posted by Andy Brown on 26 September 2016
You need a minimum screen resolution of about 700 pixels width to see our blogs. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.
Getting Excel to speak cell values on calculate
Following a question on a blog, here's how to get Excel to read out the value of certain cells whenever you recalculate a worksheet.
Turning automatic calculation off
The first thing to do is probably to stop Excel recalculating whenever you type anything in:

In Excel Options (you can reach this from by selecting File -> Options from the ribbon), choose the Formulas tab as above and go for Manual calculation.
Although Excel won't now recalculate your work automatically when you change any cell value or formula, you can press F9 at any time to force recalculation.
Creating an example
Rocket science this is not, but I want to get Excel to read out the value of my owl purchases:

Here calculating the worksheet should read out the message Value of purchase 18 pounds and 50 pence.
Assigning a macro to run on calculation
Now go into VBA (if you don't know how to do this, you're probably reading the wrong blog) and choose to attach code to the worksheet containing your cells:

Right-click on a worksheet, and choose to attach code to it as shown.
Now choose the object you want to attach code to:

Click on the drop arrow as shown, and choose to run code for an event in the workbook.
On the right-hand drop down, choose the Calculate event:

Choose this event for the worksheet.
Type in what you want to happen when you press F9:
Private Sub Worksheet_Calculate()
'on calculating the worksheet, read out the cell values
Application.Speech.Speak Range("A3").Value
Application.Speech.Speak Range("B3").Value
End Sub
Almost there - what you get is the message Value of purchase 18.5.
You have to change a value in the worksheet before pressing F9, otherwise Excel will detect that nothing has changed, and nothing will happen. Oh, and don't forget to turn your sound on!
Formatting the number properly
To get the number read out properly, apply formatting to it before reading it out:
Private Sub Worksheet_Calculate()
'on calculating the worksheet, read out the cell values
Application.Speech.Speak Range("A3").Value
'read out as "18 pounds and 50 pence"
Application.Speech.Speak Format(Range("B3").Value, "£#,##0.00")
End Sub
That should do it!
If you turn calculation back to automatic, you'll hear the message every time that you type something into a cell - which could get irritating.