insert a picture based on a linked value

Z

Zman

Steve;
I have linked values from excel embedded in my slideshows I would like to
insert a bmp based on the value embedded. In excel I was able to do it using
the worksheet_change, but I don't know enough in PowerPoint.

Here is the code I used in Excel, but I would Like to do the same in
PowerPoint:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$C$28" Then
Application.EnableEvents = False
HandleBMP
Application.EnableEvents = True
End If
End Sub

Sub HandleBMP()
Dim myCell As Range
Set myCell = Selection

On Error Resume Next
If Range("C28").Value >= 90 Then
MsgBox "Insert Stoplight"
ActiveSheet.Shapes("C28 Picture").Delete
Range("F22").Select
ActiveSheet.Pictures.Insert( _
"C:\grn-lght.bmp").Select
Selection.Name = "C28 Picture"

ElseIf Range("C28").Value >= 78 Then
MsgBox "Insert Stoplight"
ActiveSheet.Shapes("C28 Picture").Delete
Range("F22").Select
ActiveSheet.Pictures.Insert( _
"C:\yellow-lght.bmp").Select
Selection.Name = "C28 Picture"

On Error Resume Next
ElseIf Range("C28").Value < 78 Then
MsgBox "Insert Stoplight"
ActiveSheet.Shapes("C28 Picture").Delete
Range("F22").Select
ActiveSheet.Pictures.Insert( _
"C:\red-lght.bmp").Select
Selection.Name = "C28 Picture"

Else
MsgBox "Deleting"
ActiveSheet.Shapes("C28 Picture").Delete

End If

Else
MsgBox "Deleting"
ActiveSheet.Shapes("C417 Picture").Delete

End If

myCell.Select
End Sub

Thanks for all the help
 
Top