View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bernie Deitrick
 
Posts: n/a
Default Is it possible to insert a picture using formulas?

Phil,

Copy the code below, right-click on the sheet tab where you want all this to happen, select "View
Code", and paste the code into the window that appears. Change the file path and file name to your
actual values.

HTH,
Bernie
MS Excel MVP

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count < 1 Then Exit Sub
If Target.Address < "$A$1" Then Exit Sub
If Target.Value = "Yes" Then
Application.ScreenUpdating = False
Range("B9").Select
ActiveSheet.Pictures.Insert( _
"C:\Documents and Settings\PHIL\My Documents\My Pictures\test.jpg").Select
Selection.Name = "PictureName"
Range("A2").Select
Application.ScreenUpdating = True
Else
On Error Resume Next
ActiveSheet.Shapes("PictureName").Delete
End If
End Sub


"phil2401" wrote in message
...

Thanks for that Bernie, I was right then - my knowledge of macros at
this moment in time is very limited, you say it would be easy - would
you like to share your ideas with an example of any code, then I could
have a "play" and at least broaden my knowledge whilst at the same time
acheiving this little goal.

Many Thanks
Phil


--
phil2401
------------------------------------------------------------------------
phil2401's Profile: http://www.excelforum.com/member.php...o&userid=29650
View this thread: http://www.excelforum.com/showthread...hreadid=493594