#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 122
Default MACRO

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default MACRO

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


On Mon, 28 Jan 2008 14:31:01 -0800, Glenn
wrote:

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 122
Default MACRO

tit satill will not work what am i missing????????????????

"Gord Dibben" wrote:

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


On Mon, 28 Jan 2008 14:31:01 -0800, Glenn
wrote:

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



Reply
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
AutoRun Macro with a delay to give user the choice to cancel the macro wanderlust Excel Programming 2 September 28th 07 04:09 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Need syntax for RUNning a Word macro with an argument, called from an Excel macro Steve[_84_] Excel Programming 3 July 6th 06 07:42 PM
macro to delete entire rows when column A is blank ...a quick macro vikram Excel Programming 4 May 3rd 04 08:45 PM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


All times are GMT +1. The time now is 12:31 PM.

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

About Us

"It's about Microsoft Excel"