View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
J_J[_2_] J_J[_2_] is offline
external usenet poster
 
Posts: 140
Default why does it sounds every minute?-Help please

Hi Tom,

Yours and Bernie Deitrick's proposals achieved a solution of stopping
"false alarms" (beeps that occur because of the system clock minute changes
reflected by another macro). But now although there is no sound beeps on
minute changes, there is no sound either on changes with the watched range
display. Possibly I am missing something...or we all are.:)

Regards
J_J


"Tom Ogilvy" wrote in message
...
Maybe:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim c As Range, rng as Range
On Error Resume Next
set rng = Range("A1:B1")
' don't trigger on a change to A1 or B1
if not intersect(rng,Target) is nothing then exit sub
For Each c In Range("D2:G5")
If Not Application.Intersect(Target, c.Precedents) Is Nothing Then
Interaction.Beep
End If
Next c
On Error GoTo 0
End Sub

--
Regards,
Tom Ogilvy

"J_J" wrote in message
...
The below code

'-------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
Dim c As Range
On Error Resume Next
For Each c In Range("D2:G5")
If Not Application.Intersect(Target, c.Precedents) Is Nothing
Then
Interaction.Beep
End If
Next c
On Error GoTo 0
End Sub
'----------------------


sound on each minute change of my system clock. You see, cells
A1 and B1 displays the system clock hour and minute values. And the

watching
cells (Range D2:G5) look to the values displayed in A1 and
B1. Then the main macro is executed in minute intervals to let A1 and
B1 refresh their displays. Now although no "display" change is valid in

the
watched cells the sound alarm beeps in minute intervals too. Maybe my

other
suggestion may prevent that. I hope I didn't confuse you...
Hope we can solve this problem.
Regards
J_J