How to insert and load an image for Excel 2003?
Missed to check the Target Address....
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myPic As Object
If Target.Address = "$A$1" Then
If Range("A1") = 1 Then
Set myPic = ActiveSheet.Pictures.Insert("C:\TempPic.JPG")
Else
Set myPic = ActiveSheet.Pictures(1)
myPic.Delete
End If
End If
End Sub
--
Jacob
"Jacob Skaria" wrote:
Select the sheet tab which you want to work with. Right click the sheet tab
and click on 'View Code'. This will launch VBE. Paste the below code to the
right blank portion. Edit the pciture path and get back to to worksheet and
enter 1 in cell A1..If you enter anything else the pickture will be
removed.....
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myPic As Object
If Range("A1") = 1 Then
Set myPic = ActiveSheet.Pictures.Insert("C:\TempPic.JPG")
Else
Set myPic = ActiveSheet.Pictures(1)
myPic.Delete
End If
End Sub
--
Jacob
"Eric" wrote:
Does anyone have any suggestions on how to display image based on if-condition?
I have insert an image into excel, and I would like to set an if statement
to display this image, does anyone have any suggestions on how to insert
those images into excel, and how to load it in Excel 2003?
Thanks in advance for any suggestions
Eric
|