Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2008

Tip: Looking for answers? Try searching our database.

MACRO

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Glenn - 28 Jan 2008 22:31 GMT
I have built a macro that will take a clipart picture and post it to a
spacific cell in my worksheet.  This is so that the formular used in that
cell will make the macro show the proper picture.  I have built on the
worksheet a pictable and names the table.  BUT the thing will not work.  I
did this back in 2005 but I cannot remember.  Below is the macro i built, an
example for the formular for the cell, and a example for the pictable...WHAT
AM I MISSING....do I need to name the picture...I know that there has to be
one thing i have missed...THANKS A LOT FOR YOUR HELP

Sub picture1()
Private Sub Worksheet_Calculate()
   Dim oPic As Picture
   Dim myCell As Range
   Dim myRng As Range

   Set myRng = Me.Range("cc37,CE37")
   
   Me.Pictures.Visible = False
                       For Each myCell In myRng.Cells
       With myCell
           For Each oPic In Me.Pictures
               If LCase(oPic.Name) = LCase(.Text) Then
                   oPic.Visible = True
                   oPic.Top = .Top
                   oPic.Left = .Left
               End If
           Next oPic
       End With
   Next myCell

End Sub
A                B
PicTable 1    Picture
Tireman1    Picture 33    (20)
Tireman2    Picture 20
Tireman3    Picture 14
Carlift1    Picture 11
Carlift2    Picture 28
Carlift3    Picture 26
Carlift4    Picture 27
Total1    Picture 31
Total2    Picture 20
Total3    Picture 30

This formular is placed in cell cc37
=vlookup(A20,PicTable1,2,FALSE)

To print picture 33
Gord Dibben - 29 Jan 2008 00:15 GMT
Glen

This looks like John McGimpsey's code from lookuppics.xls

Download from this site with explanations.

http://www.mcgimpsey.com/excel/lookuppics.html

As written John's code allows for only one picture to be displayed and the
pictures must be stored on the same worksheet as the VLOOKUP formula.

If you need multiple pictures shown from VLOOKUPS.............

Got to Debra Dalgeish's site for a sample workbook from Bernie Dietrick for
adding pictures via selections.

Allows for more than one picture to be displayed on a sheet but also requires
the pictures be stored on same sheet.

http://www.contextures.on.ca/excelfiles.html#DataVal

DV0049 - ClipArt Selection

Gord Dibben  MS Excel MVP

>I have built a macro that will take a clipart picture and post it to a
>spacific cell in my worksheet.  This is so that the formular used in that
[quoted text clipped - 44 lines]
>
>To print picture 33
Glenn - 29 Jan 2008 20:34 GMT
tit satill will not work what am i missing????????????????

> Glen
>
[quoted text clipped - 69 lines]
> >
> >To print picture 33
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.