View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
DGolds DGolds is offline
external usenet poster
 
Posts: 7
Default FollowHyperlink automatically

Pieter Jan,
Try pasting this code at the top of your sheet's code:

Option Explicit
Private intCounter As Integer

Private Sub Worksheet_Calculate()
On Error Resume Next
Static varVal As Variant
With Range("A5")
If .Value = 100 And (.Value < varVal Or intCounter = 0) Then
ThisWorkbook.FollowHyperlink "C:\MusicFragment.mp3", , True
varVal = .Value
End If
End With
varVal = Range("A5").Value
intCounter = intCounter + 1
End Sub

You'll just need to change the name and path of the music file
HTH,
Dave

"Pieter-Jan" wrote:


Dave,

This is looking good to start with. Only one problem, the music is
playing when I type "100" in "A5", but not when 100 is calculated in
"A5". Can you solve this problem, or do I make a mistake?

Regards,
Pieter-Jan


--
Pieter-Jan
------------------------------------------------------------------------
Pieter-Jan's Profile: http://www.excelforum.com/member.php...o&userid=27954
View this thread: http://www.excelforum.com/showthread...hreadid=474567