Thread: Flashing Cell
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
[email protected] pfsardella@yahoo.com.nospam is offline
external usenet poster
 
Posts: 172
Default Flashing Cell

Chip Pearson : Playing WAV Files From VBA
http://www.cpearson.com/excel/excelM.htm#PlayWAV

A the top of a module outside of any procedures, place the following
declaration.

Declare Function sndPlaySound32 Lib "winmm.dll" Alias _
"sndPlaySoundA" (ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long

Then, to call the function, passing it the name of the WAV file you
want to play:

Call sndPlaySound32("c:\test\MySound.WAV", 0)

-------------------------------------------------------------------------------------------------------

Just some background references on using events :

David McRitchie
http://www.mvps.org/dmcritchie/excel/event.htm

Chip Pearson
http://www.cpearson.com/excel/events.htm

Right click the sheet that contains the cell that changes. Select
'View Code'. Place the following code in the sheet's module. Adjust
the references as needed.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)

If Target = Range("A1") Then
If Target.Value 20 Then _
Call sndPlaySound32("c:\test\MySound.WAV", 0)
End If

End Sub

---------------------------------------------------------------------------------------------------------------

HTH
Paul
--------------------------------------------------------------------------------------------------------------
Be advised to back up your WorkBook before attempting to make changes.
--------------------------------------------------------------------------------------------------------------
Hi

Does anyone one know how I can get a cell to flash and/or
make noise when it reacheds a certain value. I am trying
to alert the users.

Regards

Zak