PC Review


Reply
Thread Tools Rate Thread

ACTIVATING A SOUND ALERT ON CELL VALUE

 
 
SOLI
Guest
Posts: n/a
 
      20th Nov 2008
MY EXCEL BOOK RECEIVES ON-LINE QUOTES FROM A DDE LINK.
HOW DO I SET UP AN ALERT TO ACTIVATE A SOUND (OR EXECUTE A PROGRAM ) WHEN
THE CONTENT IN A CERTAIN CELL REACHES A PRE-DETERMINED VALUE?
I AM NOT TOO FAMILIAR WITH VBA BUT USUALLY I MANAGE TO COPE WITH SIMPLE
MACROS.TKS.

 
Reply With Quote
 
 
 
 
Gary''s Student
Guest
Posts: n/a
 
      20th Nov 2008
If DDE refreshes A1, then in another cell (say B1) enter:
=A1
This insures that a calculation monitors the value. Finally install the
following macro in the worksheet code area:

Private Sub Worksheet_Calculate()
If Range("B1").Value > 100 Then
Application.Speech.Speak "The price is right"
End If
End Sub

So if the DDE puts a proper value in A1, B1 will "see" it and the alert will
be issued.
--
Gary''s Student - gsnu200815


"SOLI" wrote:

> MY EXCEL BOOK RECEIVES ON-LINE QUOTES FROM A DDE LINK.
> HOW DO I SET UP AN ALERT TO ACTIVATE A SOUND (OR EXECUTE A PROGRAM ) WHEN
> THE CONTENT IN A CERTAIN CELL REACHES A PRE-DETERMINED VALUE?
> I AM NOT TOO FAMILIAR WITH VBA BUT USUALLY I MANAGE TO COPE WITH SIMPLE
> MACROS.TKS.
>

 
Reply With Quote
 
Wendy
Guest
Posts: n/a
 
      22nd Nov 2008
That is HI-Larious!!! I just tried it and it worked.. Would love more of
those kinds of macros..

"Gary''s Student" wrote:

> If DDE refreshes A1, then in another cell (say B1) enter:
> =A1
> This insures that a calculation monitors the value. Finally install the
> following macro in the worksheet code area:
>
> Private Sub Worksheet_Calculate()
> If Range("B1").Value > 100 Then
> Application.Speech.Speak "The price is right"
> End If
> End Sub
>
> So if the DDE puts a proper value in A1, B1 will "see" it and the alert will
> be issued.
> --
> Gary''s Student - gsnu200815
>
>
> "SOLI" wrote:
>
> > MY EXCEL BOOK RECEIVES ON-LINE QUOTES FROM A DDE LINK.
> > HOW DO I SET UP AN ALERT TO ACTIVATE A SOUND (OR EXECUTE A PROGRAM ) WHEN
> > THE CONTENT IN A CERTAIN CELL REACHES A PRE-DETERMINED VALUE?
> > I AM NOT TOO FAMILIAR WITH VBA BUT USUALLY I MANAGE TO COPE WITH SIMPLE
> > MACROS.TKS.
> >

 
Reply With Quote
 
SOLI
Guest
Posts: n/a
 
      23rd Nov 2008
Gary's Student
Beautiful ! It works.Thanks a lot.So simple and short.
Maybe you can expand a little more , telling me how to make the speech
repeat itself either a few times and/or continuously until I stop it by
hitting any key.

Also how can I change the value that activates the macro(the 100) to any
other number without having to edit the macro.If I could place this new
number(the substitute for the number 100) in cell C1 for example, it would be
easier.
How can I put a second macro for a different cell to be monitored?In the
same code?
Soli
"SOLI" wrote:

> MY EXCEL BOOK RECEIVES ON-LINE QUOTES FROM A DDE LINK.
> HOW DO I SET UP AN ALERT TO ACTIVATE A SOUND (OR EXECUTE A PROGRAM ) WHEN
> THE CONTENT IN A CERTAIN CELL REACHES A PRE-DETERMINED VALUE?
> I AM NOT TOO FAMILIAR WITH VBA BUT USUALLY I MANAGE TO COPE WITH SIMPLE
> MACROS.TKS.
>

 
Reply With Quote
 
Gary''s Student
Guest
Posts: n/a
 
      23rd Nov 2008
This version allows you to put the number in cell C1
It also repeats the message 4 times.

Private Sub Worksheet_Calculate()
If Range("B1").Value > Range("C1").Value Then
For i = 1 To 4
Application.Speech.Speak "The price is right"
Next
End If
End Sub

--
Gary''s Student - gsnu200815


"SOLI" wrote:

> Gary's Student
> Beautiful ! It works.Thanks a lot.So simple and short.
> Maybe you can expand a little more , telling me how to make the speech
> repeat itself either a few times and/or continuously until I stop it by
> hitting any key.
>
> Also how can I change the value that activates the macro(the 100) to any
> other number without having to edit the macro.If I could place this new
> number(the substitute for the number 100) in cell C1 for example, it would be
> easier.
> How can I put a second macro for a different cell to be monitored?In the
> same code?
> Soli
> "SOLI" wrote:
>
> > MY EXCEL BOOK RECEIVES ON-LINE QUOTES FROM A DDE LINK.
> > HOW DO I SET UP AN ALERT TO ACTIVATE A SOUND (OR EXECUTE A PROGRAM ) WHEN
> > THE CONTENT IN A CERTAIN CELL REACHES A PRE-DETERMINED VALUE?
> > I AM NOT TOO FAMILIAR WITH VBA BUT USUALLY I MANAGE TO COPE WITH SIMPLE
> > MACROS.TKS.
> >

 
Reply With Quote
 
SOLI
Guest
Posts: n/a
 
      23rd Nov 2008
GREAT! it works well.
may abuse for more?
Is it possible to put more than 1 alert in a sheet? Say you want to monitor
cell A1 and F1...

"Gary''s Student" wrote:

> This version allows you to put the number in cell C1
> It also repeats the message 4 times.
>
> Private Sub Worksheet_Calculate()
> If Range("B1").Value > Range("C1").Value Then
> For i = 1 To 4
> Application.Speech.Speak "The price is right"
> Next
> End If
> End Sub
>
> --
> Gary''s Student - gsnu200815
>
>
> "SOLI" wrote:
>
> > Gary's Student
> > Beautiful ! It works.Thanks a lot.So simple and short.
> > Maybe you can expand a little more , telling me how to make the speech
> > repeat itself either a few times and/or continuously until I stop it by
> > hitting any key.
> >
> > Also how can I change the value that activates the macro(the 100) to any
> > other number without having to edit the macro.If I could place this new
> > number(the substitute for the number 100) in cell C1 for example, it would be
> > easier.
> > How can I put a second macro for a different cell to be monitored?In the
> > same code?
> > Soli
> > "SOLI" wrote:
> >
> > > MY EXCEL BOOK RECEIVES ON-LINE QUOTES FROM A DDE LINK.
> > > HOW DO I SET UP AN ALERT TO ACTIVATE A SOUND (OR EXECUTE A PROGRAM ) WHEN
> > > THE CONTENT IN A CERTAIN CELL REACHES A PRE-DETERMINED VALUE?
> > > I AM NOT TOO FAMILIAR WITH VBA BUT USUALLY I MANAGE TO COPE WITH SIMPLE
> > > MACROS.TKS.
> > >

 
Reply With Quote
 
Gary''s Student
Guest
Posts: n/a
 
      23rd Nov 2008
Very similar.

I will update this post with a more general solution tomorrow.
--
Gary''s Student - gsnu200815


"SOLI" wrote:

> GREAT! it works well.
> may abuse for more?
> Is it possible to put more than 1 alert in a sheet? Say you want to monitor
> cell A1 and F1...
>
> "Gary''s Student" wrote:
>
> > This version allows you to put the number in cell C1
> > It also repeats the message 4 times.
> >
> > Private Sub Worksheet_Calculate()
> > If Range("B1").Value > Range("C1").Value Then
> > For i = 1 To 4
> > Application.Speech.Speak "The price is right"
> > Next
> > End If
> > End Sub
> >
> > --
> > Gary''s Student - gsnu200815
> >
> >
> > "SOLI" wrote:
> >
> > > Gary's Student
> > > Beautiful ! It works.Thanks a lot.So simple and short.
> > > Maybe you can expand a little more , telling me how to make the speech
> > > repeat itself either a few times and/or continuously until I stop it by
> > > hitting any key.
> > >
> > > Also how can I change the value that activates the macro(the 100) to any
> > > other number without having to edit the macro.If I could place this new
> > > number(the substitute for the number 100) in cell C1 for example, it would be
> > > easier.
> > > How can I put a second macro for a different cell to be monitored?In the
> > > same code?
> > > Soli
> > > "SOLI" wrote:
> > >
> > > > MY EXCEL BOOK RECEIVES ON-LINE QUOTES FROM A DDE LINK.
> > > > HOW DO I SET UP AN ALERT TO ACTIVATE A SOUND (OR EXECUTE A PROGRAM ) WHEN
> > > > THE CONTENT IN A CERTAIN CELL REACHES A PRE-DETERMINED VALUE?
> > > > I AM NOT TOO FAMILIAR WITH VBA BUT USUALLY I MANAGE TO COPE WITH SIMPLE
> > > > MACROS.TKS.
> > > >

 
Reply With Quote
 
SOLI
Guest
Posts: n/a
 
      24th Nov 2008
since you are going to update to a general solution,maybe you could include a
choice of what the alert will speak .It could speak the number contained in
the cell B1 instead of a generic unspecified "The price is right".Please
maintain the generic alert also.
soli

"Gary''s Student" wrote:

> Very similar.
>
> I will update this post with a more general solution tomorrow.
> --
> Gary''s Student - gsnu200815
>
>
> "SOLI" wrote:
>
> > GREAT! it works well.
> > may abuse for more?
> > Is it possible to put more than 1 alert in a sheet? Say you want to monitor
> > cell A1 and F1...
> >
> > "Gary''s Student" wrote:
> >
> > > This version allows you to put the number in cell C1
> > > It also repeats the message 4 times.
> > >
> > > Private Sub Worksheet_Calculate()
> > > If Range("B1").Value > Range("C1").Value Then
> > > For i = 1 To 4
> > > Application.Speech.Speak "The price is right"
> > > Next
> > > End If
> > > End Sub
> > >
> > > --
> > > Gary''s Student - gsnu200815
> > >
> > >
> > > "SOLI" wrote:
> > >
> > > > Gary's Student
> > > > Beautiful ! It works.Thanks a lot.So simple and short.
> > > > Maybe you can expand a little more , telling me how to make the speech
> > > > repeat itself either a few times and/or continuously until I stop it by
> > > > hitting any key.
> > > >
> > > > Also how can I change the value that activates the macro(the 100) to any
> > > > other number without having to edit the macro.If I could place this new
> > > > number(the substitute for the number 100) in cell C1 for example, it would be
> > > > easier.
> > > > How can I put a second macro for a different cell to be monitored?In the
> > > > same code?
> > > > Soli
> > > > "SOLI" wrote:
> > > >
> > > > > MY EXCEL BOOK RECEIVES ON-LINE QUOTES FROM A DDE LINK.
> > > > > HOW DO I SET UP AN ALERT TO ACTIVATE A SOUND (OR EXECUTE A PROGRAM ) WHEN
> > > > > THE CONTENT IN A CERTAIN CELL REACHES A PRE-DETERMINED VALUE?
> > > > > I AM NOT TOO FAMILIAR WITH VBA BUT USUALLY I MANAGE TO COPE WITH SIMPLE
> > > > > MACROS.TKS.
> > > > >

 
Reply With Quote
 
Gary''s Student
Guest
Posts: n/a
 
      24th Nov 2008
O.K.
--
Gary''s Student - gsnu200815
 
Reply With Quote
 
SOLI
Guest
Posts: n/a
 
      24th Nov 2008
Sorry to barge in again.
Yesterday the DDE link was not available so I tested the macro in a simple
Excel sheet. however , to-day I tested it with the real thing and since the
imput is continuous(stream) the ^price is right^ every second and it did not
stop speaking that. Probably there has to be a brake so we can control how
many times the speech (or in new version - the quote )is repeated .
Also it is not enough that C1should indicate the value to be monitored, the
sign <=> also should be able to be substituted within C1 or C2.
soli
"Gary''s Student" wrote:

> O.K.
> --
> Gary''s Student - gsnu200815

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Activating a sound alert on cell value Sebastian Flyte Microsoft Excel Misc 0 28th Dec 2009 04:12 PM
Re: How to Create Sound Alert and Email Alert when Macro is Finish Tom Ogilvy Microsoft Excel Programming 0 30th Nov 2006 11:12 PM
Re: How to Create Sound Alert and Email Alert when Macro is Finish Bob Phillips Microsoft Excel Programming 0 30th Nov 2006 09:21 PM
Re: How to Create Sound Alert and Email Alert when Macro is Finished Bob Davison Microsoft Excel Programming 0 30th Nov 2006 08:14 PM
Sound+color alert if cell changed in another worksheet florinel Microsoft Excel Misc 0 25th May 2006 04:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:45 PM.