LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,670
Default How to insert and load an image for Excel 2003?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel 2003 slow to load karatas1 Excel Discussion (Misc queries) 0 July 17th 09 03:23 AM
auto resize when insert large image to excel sajid Excel Worksheet Functions 4 November 21st 06 03:40 PM
Load image from directory for custom toolbar of Excel 2000 Padam Excel Worksheet Functions 0 August 5th 06 06:33 PM
How do I insert an image in Access from a linked Excel spreadshee. Jen Excel Discussion (Misc queries) 1 November 18th 05 07:53 PM
insert image in head excel file? ducenis Excel Discussion (Misc queries) 2 January 15th 05 12:14 AM


All times are GMT +1. The time now is 04:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"