View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jake Marx[_3_] Jake Marx[_3_] is offline
external usenet poster
 
Posts: 860
Default can VBA be used to sound a *.wav file on condition(s)?

Hi J_J,

Sorry - I should have caught that. You can put an On Error Resume Next at
the beginning of the code and an On Error Goto 0 at the end of the code to
fix it.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


J_J wrote:
Hi Jake,
I received a "no cells were found" error (Run time error '1004') when
activating the workbook for the

If Not Application.Intersect(Target, c.Precedents) Is Nothing
Then
line of your code. I've changed my region to D2:G6...as it is the
region I'd watch.
Any ideas why?
J_J



"Jake Marx" wrote in message
...
Hi J_J,

You should be able to do this with the Change event of the Worksheet
object. Copy the following code into the worksheet's code module
(right-click your sheet tab and select View Code):

Private Sub Worksheet_Change(ByVal Target As Range)
Dim c As Range

For Each c In Range("A6:D6")
If Not Application.Intersect(Target, _
c.Precedents) Is Nothing Then
Interaction.Beep
End If
Next c
End Sub


Just change the A6:D6 to the range containing the 10-15 cells that
contain the formulas you want to watch.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


J_J wrote:
Hi,
My question is on the subject line...
I have a worksheet which has 10-15 cells with long IF statements as
formulas.
The cell formulas are in the form of (not exactly of course):

=IF(A1=condition1 OR B1=condition2, display"first message", else
if(A1=condition2 AND B1=condition3), display"second message", else
display "third message")
etc.

I need to use my laptops internal speaker to sound an alarm (bip) or
call a *.wav file to play.... "if" any one of the cell value is
"changed" because of the conditions on any one of the cell is
changed .
Can this be done via VBA?. I'd appreciate if code samples can be
given.
TIA
J_J