Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

events in excel vba

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Events In Excel VBA

Events In Excel VBA

ResolvedVersion Standard

James has attended:
Excel VBA Intro Intermediate course

Events In Excel VBA

Hi,

I am trying to create a macro that, every time a celll value changes by a tenth of a point (either up or down), then excel speaks the new value in the cell.

The code below is what I have implemented:
1. Open the Visual Basic Edit (Tools>Macro>Visual Basic Editor)
2. In the left window, right click Sheet1 and select View Code.
3. At the top of the Book1 - Sheet1 Code dialog box, there are two dropdowns. From the left dropdown select Worksheet.
4. Copy and Paste the following code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Target.Speak
End If
End Sub

There are two problems, in order of importance, with the above code:
1. If cell "A1"" contains a formula, it does not recognise the fact that a the cell value has changed and thus does not speak the new value. (This is vital as the cell I want excel to speak is updated automatically from an external application running simulatneously)
2. It speaks when the value changes by less than a tenth of a point.

Any help would be greatly appreciated, including a relevant text book recommendation.

Many thanks!

James

RE: Events In Excel VBA

Hi James

Our apologies for missing a response to you. If you are still looking for a solution, we would recommend the following:

consultancy services.

3 steps to organising your consultancy

1) Profile & review your requirements
(email us some samples of your work, and list of top outcomes)

2) Receive proposal
- Scope of work
- Timeframes
- Pricing

3) Sign our consultancy agreement

If you wish to follow this then please let us know.

Regards

Jacob

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Random Numbers

Type =RAND()*200 to generate a number between 1 and 200.
Use the fill handle to drag down and populate as many cells as you'd like with random numbers.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.12 secs.