Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to edit the code to insert more than 1 image?
Does anyone have any suggestions on how to edit the following code to insert
more than 1 image? If A1 = 1, then display image from ("C:\TempPic.JPG"), else If A1 = 2, then display image from ("C:\TempPic2.JPG") else display nothing. Does anyone have any suggestions on how to do it for Excel 2003? Thanks in advance for any suggestions Eric 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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to edit the code to insert more than 1 image?
Try
Private Sub Worksheet_Change(ByVal Target As Range) Dim myPic As Object If Target.Address = "$A$1" Then On Error Resume Next Set myPic = ActiveSheet.Pictures(1) On Error GoTo 0 If Not myPic Is Nothing Then myPic.Delete If Range("A1") = 1 Then ActiveSheet.Pictures.Insert ("C:\TempPic.JPG") Else ActiveSheet.Pictures.Insert ("C:\TempPic2.JPG") End If End If End Sub -- Jacob "Eric" wrote: Does anyone have any suggestions on how to edit the following code to insert more than 1 image? If A1 = 1, then display image from ("C:\TempPic.JPG"), else If A1 = 2, then display image from ("C:\TempPic2.JPG") else display nothing. Does anyone have any suggestions on how to do it for Excel 2003? Thanks in advance for any suggestions Eric 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to edit the code to insert more than 1 image?
Thank you very much for suggestions
Do you have any suggestions on how to set the location to display image? Thank you very much for suggestions Eric "Jacob Skaria" wrote: Try Private Sub Worksheet_Change(ByVal Target As Range) Dim myPic As Object If Target.Address = "$A$1" Then On Error Resume Next Set myPic = ActiveSheet.Pictures(1) On Error GoTo 0 If Not myPic Is Nothing Then myPic.Delete If Range("A1") = 1 Then ActiveSheet.Pictures.Insert ("C:\TempPic.JPG") Else ActiveSheet.Pictures.Insert ("C:\TempPic2.JPG") End If End If End Sub -- Jacob "Eric" wrote: Does anyone have any suggestions on how to edit the following code to insert more than 1 image? If A1 = 1, then display image from ("C:\TempPic.JPG"), else If A1 = 2, then display image from ("C:\TempPic2.JPG") else display nothing. Does anyone have any suggestions on how to do it for Excel 2003? Thanks in advance for any suggestions Eric 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
edit ribbon image ? | Excel Programming | |||
Edit Button image | Excel Programming | |||
Calling Edit Buttom Image? | Excel Programming | |||
image edit control | Excel Programming | |||
Image Edit and WebBrowser controls | Excel Programming |