Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thank you very much for suggestions
I get 2 images, if A1=1, then 1.gif, else if A1=2, then 2.gif, else nothing. Do you have any suggestions on how to modify the code to do it? Thank you very much for any suggestions Eric "Jacob Skaria" wrote: 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
excel 2003 slow to load | Excel Discussion (Misc queries) | |||
auto resize when insert large image to excel | Excel Worksheet Functions | |||
Load image from directory for custom toolbar of Excel 2000 | Excel Worksheet Functions | |||
How do I insert an image in Access from a linked Excel spreadshee. | Excel Discussion (Misc queries) | |||
insert image in head excel file? | Excel Discussion (Misc queries) |