Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
547 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
How to get Excel to read out cell values on calculation |
---|
A short blog explaining how you can get Excel to read out values in cells every time that you recalculate a worksheet. |
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.
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.
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.
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!
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.
Some other pages relevant to the above blog include:
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2024. All Rights Reserved.