Thread: Embeded Wav
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Desert Piranha[_74_] Desert Piranha[_74_] is offline
external usenet poster
 
Posts: 1
Default Embeded Wav


Hi All,

For those following the thread. Due to a really strange active cel
condition,
after the code was ran. Norman has updated it. Here is the code in it
entirety.

Code
-------------------
'=============
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range

On Error Resume Next
'Named Range = myCell
Set rng = Intersect(Target, Me.Range("myCell").Precedents)
On Error GoTo 0

If Not rng Is Nothing And Range("myCell").Value 100 Then
Call MyMacro
End If

End Sub
'<<=============
'=============
Sub MyMacro()
Dim SH As Worksheet
Application.ScreenUpdating = False

Set SH = ThisWorkbook.Sheets("Sheet2") '<<==== CHANGE
With SH.OLEObjects("Object 1") '<<==== CHANGE

.Visible = False
.Verb
End With

Application.ScreenUpdating = True
End Sub
'<<============
-------------------


Thx much Norman,
Dave

Norman Jones Wrote:
Hi Dave,

Sorry, I overlooked the condition!

Try:

'=============
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range

On Error Resume Next
Set rng = Intersect(Target, Me.Range("myCell").Precedents)
On Error GoTo 0

If Not rng Is Nothing And Range("Mycell").Value 100 Then
Call MyMacro
End If
End Sub
'<<=============

Good luck in the World Cup.


And to you!!


---
Regards,
Norma


--
Desert Piranh

-----------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...fo&userid=2893
View this thread: http://www.excelforum.com/showthread.php?threadid=55072