Want to make conditional sounds based on cell values in Excel

H

howard.freese

Conditional formatting.

Is it possible to insert logic formulae to make specific sounds based on
computed cell values in an Excel worksheet?

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/com...57824f8aae&dg=microsoft.public.excel.newusers
 
B

Bernie Deitrick

Howard,

You can play sounds using VBA code within the calculation event:

Add this to a module:

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

Sub PlayMySound()
'Change the filepath and name
Call sndPlaySound32("c:\folder\Filename.WAV", 0)
End Sub

Add this worksheet event

Private Sub Worksheet_Calculate()
If Range("A1").Value <> Range("A2").Value Then
Application.EnableEvents = False
PlayMySound
Range("A2").Value = Range("A1").Value
Application.EnableEvents = True
End If
End Sub


HTH,
Bernie
MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top