Questions On Calling Graphics via Cell Value

D

documike

Thanks to a tip from Dave Peterson, he directed me to a site that has
example code which I've included. There's also a link a the bottom of the
referenced page to download a sample worksheet however it doens't appear to
be working. (hangs)
Here's the reference: http://www.mcgimpsey.com/excel/lookuppics.html

Here's the code:
Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("F1")
For Each oPic In Me.Pictures
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Exit For
End If
Next oPic
End With
End Sub

My question is how do bring the graphics into the sheet, (insert, picture,
file & then assign a macro or ???)
I'm not understanding the oPic references etc.
Thanks
 
P

Peo Sjoblom

The pictures are hidden, there is a line of code

Me.Pictures.Visible = False

hides the pictures

Download and extract the zip file before open the file

--
Regards,

Peo Sjoblom

(No private emails please, for everyone's
benefit keep the discussion in the newsgroup/forum)
 
P

Peo Sjoblom

I can download it an email it to you if you post a valid email address

--
Regards,

Peo Sjoblom

(No private emails please, for everyone's
benefit keep the discussion in the newsgroup/forum)
 
D

documike

I downloaded to my laptop...I believe somethink in my IE blocking software
must of been blocking it. Thanks for offering however.
 
D

Dave Peterson

This assumes that you have added all your pictures to the worksheet.

And you rightclick on the worksheet and select view code and paste that
Worksheet_calculate event code in that codewindow.

This code gets called each time the worksheet calculates. (It would be nice for
a formula returns the name of the picture.)

(You'll see that in JE's sample workbook, I bet.)
 
Top