Insert Picture from dropdown selection

I'm working at a Marina and trying to make a comparison chart for different 
types of boats. I am trying to make a list, and based upon the users 
selection of a boat, insert a corresponding picture to match the boat 
selected from that list. I've researched other thread discussions, and tried 
to approach it this way, as reccommended by Ron Coderre:

Select Sheet2 and turn off Grid Lines
(Tools>Options>View tab:Uncheck Grid Lines)
1)For each picture to be displayed:
1a. Insert>Picture from file. (select picture, put it in the sheet and 
resize it).
1b. Select the range of cells that contains the picture.
1c. Name that range of cells, using the prefix "pic" followed by the 
dropdown list text:
Example for a picture of an Elephant on cells A2:D10:
Select those cells
Insert>Name>Define
Name: picElephant

2)Build your data validation list on a cell in Sheet1 and pick one of the 
items.
If you need help: use Debra Dalgleish's site: 
http://www.contextures.com/xlDataVal01.html

3)Create a dynamic range name that refers to that cell:
Insert>Name>Define
Name: ShowMyPic
RefersTo: =INDIRECT("pic"&Sheet1!$A$1)
....or whatever cell you chose.

4)Copy/Paste one of the pictures from Sheet2 to the display cell on Sheet1.

5)With picture selected, type this in the formula bar, then press [Enter]:
=ShowMyPic


After trying this method, instead of getting the picture inserted, I get the 
name of the cells that the picture is in...(the name I gave the cells that 
contained the picture). It does change according to my selection from the 
list, but doesnt display the picture. The text that is returned instead of 
the picture seems distorted as well. Any ideas of what I could be doing 
wrong?    I've also tried making this work through macros which I am even 
less familiar with. I was able to get that to work for one selection, but I 
dont know how to properly code it to work for every boat in my list. I used 
this code reccommended by Bernie Deitrick:

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

I assume I would need to somehow nest this or create If - Else commands?  
Also to clarify, I did change the file names and paths to those that matched 
my project. It worked for one selection, but I don't know how to code it for 
a list of say 40 boats

 Any suggestions of the easiest way to go about doing this? Ive been trying 
for a few days now, and could use any help I can get!

0
Channel (1)
2/17/2006 7:31:16 PM
excel.newusers 15348 articles. 2 followers. Follow

21 Replies
826 Views

Similar Articles

[PageSpeed] 51

I'll try to address the method I posted. 

With a value in the drop  down list, you should be able to:
Edit>Go to>
In the reference field, type: ShowMyPic
Click the [OK] button

That should bring you to the range that contains the picture that is 
referenced.
If it does not, then the problem is in your definition of ShowMyPic

Example:
with this definition...
Name: ShowMyPic
RefersTo: =INDIRECT("pic"&Sheet1!$A$1)

If cell A1 on Sheet1 contains "Camel" and you have a range named: picCamel, 
then ShowMyPic will refer to that range.

In order to help, I'll need a little more information:
1)What is the exact location of your dropdown list (sheet name and cell 
address)?
2)What is the exact name you gave to one of the pictures?


***********
Regards,
Ron

XL2002, WinXP-Pro


"Mike at Channel" wrote:

> I'm working at a Marina and trying to make a comparison chart for different 
> types of boats. I am trying to make a list, and based upon the users 
> selection of a boat, insert a corresponding picture to match the boat 
> selected from that list. I've researched other thread discussions, and tried 
> to approach it this way, as reccommended by Ron Coderre:
> 
> Select Sheet2 and turn off Grid Lines
> (Tools>Options>View tab:Uncheck Grid Lines)
> 1)For each picture to be displayed:
> 1a. Insert>Picture from file. (select picture, put it in the sheet and 
> resize it).
> 1b. Select the range of cells that contains the picture.
> 1c. Name that range of cells, using the prefix "pic" followed by the 
> dropdown list text:
> Example for a picture of an Elephant on cells A2:D10:
> Select those cells
> Insert>Name>Define
> Name: picElephant
> 
> 2)Build your data validation list on a cell in Sheet1 and pick one of the 
> items.
> If you need help: use Debra Dalgleish's site: 
> http://www.contextures.com/xlDataVal01.html
> 
> 3)Create a dynamic range name that refers to that cell:
> Insert>Name>Define
> Name: ShowMyPic
> RefersTo: =INDIRECT("pic"&Sheet1!$A$1)
> ...or whatever cell you chose.
> 
> 4)Copy/Paste one of the pictures from Sheet2 to the display cell on Sheet1.
> 
> 5)With picture selected, type this in the formula bar, then press [Enter]:
> =ShowMyPic
> 
> 
> After trying this method, instead of getting the picture inserted, I get the 
> name of the cells that the picture is in...(the name I gave the cells that 
> contained the picture). It does change according to my selection from the 
> list, but doesnt display the picture. The text that is returned instead of 
> the picture seems distorted as well. Any ideas of what I could be doing 
> wrong?    I've also tried making this work through macros which I am even 
> less familiar with. I was able to get that to work for one selection, but I 
> dont know how to properly code it to work for every boat in my list. I used 
> this code reccommended by Bernie Deitrick:
> 
> 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
> 
> I assume I would need to somehow nest this or create If - Else commands?  
> Also to clarify, I did change the file names and paths to those that matched 
> my project. It worked for one selection, but I don't know how to code it for 
> a list of say 40 boats
> 
>  Any suggestions of the easiest way to go about doing this? Ive been trying 
> for a few days now, and could use any help I can get!
> 
0
2/17/2006 8:55:27 PM
Ron, 
Thanks for the response, Here's exactly what I've created as a trial 
experiment:
3 worksheets: Sheet one contains a drop down list created using data 
validation in cell A5. I want the picture that matches the selction from that 
to be displayed in cell A2 of that same sheet, sheet 1. On Sheet two I have 
three pictures of boats. Picture one is placed over cells  A1-D6  ( 
=Sheet2!$A$1:$D$6) and is named "picOne".  Picture two is placed over cells 
A7- D12 (=Sheet2!$A$7:$D$12) and is named "picTwo". Picture three is placed 
over cells A13- D18 (=Sheet2!$A$13:$D$18) and is named "picThree". Finally on 
my third worksheet I have my list of names (One, Two, and Three) on cells 
A1-A3 used for my data validation on sheet 1. 

"Ron Coderre" wrote:

> I'll try to address the method I posted. 
> 
> With a value in the drop  down list, you should be able to:
> Edit>Go to>
> In the reference field, type: ShowMyPic
> Click the [OK] button
> 
> That should bring you to the range that contains the picture that is 
> referenced.
> If it does not, then the problem is in your definition of ShowMyPic
> 
> Example:
> with this definition...
> Name: ShowMyPic
> RefersTo: =INDIRECT("pic"&Sheet1!$A$1)
> 
> If cell A1 on Sheet1 contains "Camel" and you have a range named: picCamel, 
> then ShowMyPic will refer to that range.
> 
> In order to help, I'll need a little more information:
> 1)What is the exact location of your dropdown list (sheet name and cell 
> address)?
> 2)What is the exact name you gave to one of the pictures?
> 
> 
> ***********
> Regards,
> Ron
> 
> XL2002, WinXP-Pro
> 
> 
> "Mike at Channel" wrote:
> 
> > I'm working at a Marina and trying to make a comparison chart for different 
> > types of boats. I am trying to make a list, and based upon the users 
> > selection of a boat, insert a corresponding picture to match the boat 
> > selected from that list. I've researched other thread discussions, and tried 
> > to approach it this way, as reccommended by Ron Coderre:
> > 
> > Select Sheet2 and turn off Grid Lines
> > (Tools>Options>View tab:Uncheck Grid Lines)
> > 1)For each picture to be displayed:
> > 1a. Insert>Picture from file. (select picture, put it in the sheet and 
> > resize it).
> > 1b. Select the range of cells that contains the picture.
> > 1c. Name that range of cells, using the prefix "pic" followed by the 
> > dropdown list text:
> > Example for a picture of an Elephant on cells A2:D10:
> > Select those cells
> > Insert>Name>Define
> > Name: picElephant
> > 
> > 2)Build your data validation list on a cell in Sheet1 and pick one of the 
> > items.
> > If you need help: use Debra Dalgleish's site: 
> > http://www.contextures.com/xlDataVal01.html
> > 
> > 3)Create a dynamic range name that refers to that cell:
> > Insert>Name>Define
> > Name: ShowMyPic
> > RefersTo: =INDIRECT("pic"&Sheet1!$A$1)
> > ...or whatever cell you chose.
> > 
> > 4)Copy/Paste one of the pictures from Sheet2 to the display cell on Sheet1.
> > 
> > 5)With picture selected, type this in the formula bar, then press [Enter]:
> > =ShowMyPic
> > 
> > 
> > After trying this method, instead of getting the picture inserted, I get the 
> > name of the cells that the picture is in...(the name I gave the cells that 
> > contained the picture). It does change according to my selection from the 
> > list, but doesnt display the picture. The text that is returned instead of 
> > the picture seems distorted as well. Any ideas of what I could be doing 
> > wrong?    I've also tried making this work through macros which I am even 
> > less familiar with. I was able to get that to work for one selection, but I 
> > dont know how to properly code it to work for every boat in my list. I used 
> > this code reccommended by Bernie Deitrick:
> > 
> > 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
> > 
> > I assume I would need to somehow nest this or create If - Else commands?  
> > Also to clarify, I did change the file names and paths to those that matched 
> > my project. It worked for one selection, but I don't know how to code it for 
> > a list of say 40 boats
> > 
> >  Any suggestions of the easiest way to go about doing this? Ive been trying 
> > for a few days now, and could use any help I can get!
> > 
0
2/21/2006 9:39:27 PM
Have you had a look at JE McGimsey's site:

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

I think it is exactly what you're trying to do.


-- 
Cutter
------------------------------------------------------------------------
Cutter's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=9848
View this thread: http://www.excelforum.com/showthread.php?threadid=513797

0
2/21/2006 10:14:51 PM
You don't mention if the model you created works. Does it?

If not...did you create the dynamic ShowMyPic range?


***********
Regards,
Ron

XL2002, WinXP-Pro


"Mike at Channel" wrote:

> Ron, 
> Thanks for the response, Here's exactly what I've created as a trial 
> experiment:
> 3 worksheets: Sheet one contains a drop down list created using data 
> validation in cell A5. I want the picture that matches the selction from that 
> to be displayed in cell A2 of that same sheet, sheet 1. On Sheet two I have 
> three pictures of boats. Picture one is placed over cells  A1-D6  ( 
> =Sheet2!$A$1:$D$6) and is named "picOne".  Picture two is placed over cells 
> A7- D12 (=Sheet2!$A$7:$D$12) and is named "picTwo". Picture three is placed 
> over cells A13- D18 (=Sheet2!$A$13:$D$18) and is named "picThree". Finally on 
> my third worksheet I have my list of names (One, Two, and Three) on cells 
> A1-A3 used for my data validation on sheet 1. 
> 
> "Ron Coderre" wrote:
> 
> > I'll try to address the method I posted. 
> > 
> > With a value in the drop  down list, you should be able to:
> > Edit>Go to>
> > In the reference field, type: ShowMyPic
> > Click the [OK] button
> > 
> > That should bring you to the range that contains the picture that is 
> > referenced.
> > If it does not, then the problem is in your definition of ShowMyPic
> > 
> > Example:
> > with this definition...
> > Name: ShowMyPic
> > RefersTo: =INDIRECT("pic"&Sheet1!$A$1)
> > 
> > If cell A1 on Sheet1 contains "Camel" and you have a range named: picCamel, 
> > then ShowMyPic will refer to that range.
> > 
> > In order to help, I'll need a little more information:
> > 1)What is the exact location of your dropdown list (sheet name and cell 
> > address)?
> > 2)What is the exact name you gave to one of the pictures?
> > 
> > 
> > ***********
> > Regards,
> > Ron
> > 
> > XL2002, WinXP-Pro
> > 
> > 
> > "Mike at Channel" wrote:
> > 
> > > I'm working at a Marina and trying to make a comparison chart for different 
> > > types of boats. I am trying to make a list, and based upon the users 
> > > selection of a boat, insert a corresponding picture to match the boat 
> > > selected from that list. I've researched other thread discussions, and tried 
> > > to approach it this way, as reccommended by Ron Coderre:
> > > 
> > > Select Sheet2 and turn off Grid Lines
> > > (Tools>Options>View tab:Uncheck Grid Lines)
> > > 1)For each picture to be displayed:
> > > 1a. Insert>Picture from file. (select picture, put it in the sheet and 
> > > resize it).
> > > 1b. Select the range of cells that contains the picture.
> > > 1c. Name that range of cells, using the prefix "pic" followed by the 
> > > dropdown list text:
> > > Example for a picture of an Elephant on cells A2:D10:
> > > Select those cells
> > > Insert>Name>Define
> > > Name: picElephant
> > > 
> > > 2)Build your data validation list on a cell in Sheet1 and pick one of the 
> > > items.
> > > If you need help: use Debra Dalgleish's site: 
> > > http://www.contextures.com/xlDataVal01.html
> > > 
> > > 3)Create a dynamic range name that refers to that cell:
> > > Insert>Name>Define
> > > Name: ShowMyPic
> > > RefersTo: =INDIRECT("pic"&Sheet1!$A$1)
> > > ...or whatever cell you chose.
> > > 
> > > 4)Copy/Paste one of the pictures from Sheet2 to the display cell on Sheet1.
> > > 
> > > 5)With picture selected, type this in the formula bar, then press [Enter]:
> > > =ShowMyPic
> > > 
> > > 
> > > After trying this method, instead of getting the picture inserted, I get the 
> > > name of the cells that the picture is in...(the name I gave the cells that 
> > > contained the picture). It does change according to my selection from the 
> > > list, but doesnt display the picture. The text that is returned instead of 
> > > the picture seems distorted as well. Any ideas of what I could be doing 
> > > wrong?    I've also tried making this work through macros which I am even 
> > > less familiar with. I was able to get that to work for one selection, but I 
> > > dont know how to properly code it to work for every boat in my list. I used 
> > > this code reccommended by Bernie Deitrick:
> > > 
> > > 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
> > > 
> > > I assume I would need to somehow nest this or create If - Else commands?  
> > > Also to clarify, I did change the file names and paths to those that matched 
> > > my project. It worked for one selection, but I don't know how to code it for 
> > > a list of say 40 boats
> > > 
> > >  Any suggestions of the easiest way to go about doing this? Ive been trying 
> > > for a few days now, and could use any help I can get!
> > > 
0
2/21/2006 11:15:27 PM
Cutter,
THANK YOU! I've been trying different methods for over a week now, and 
finally got it to work. Ron, thanks as well for the response, I must have 
been making some small error that I didn't recognize, a wrong reference or 
something, but since the V lookup method worked for me, I will just go with 
that. That is exactly how I wanted it to work. I appreciate all your help, 
and prompt reply, and I think the message board is a great resource. Thanks 
for helping out!

"Cutter" wrote:

> 
> Have you had a look at JE McGimsey's site:
> 
> http://www.mcgimpsey.com/excel/lookuppics.html
> 
> I think it is exactly what you're trying to do.
> 
> 
> -- 
> Cutter
> ------------------------------------------------------------------------
> Cutter's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=9848
> View this thread: http://www.excelforum.com/showthread.php?threadid=513797
> 
> 
0
2/22/2006 1:40:21 PM
One More problem, 
that solution worked great for one pull down list, but I'm trying to compare 
two boats by selection, so I need apply this code to two dropdown lists:

Option Explicit

    Private Sub Worksheet_Calculate()
        Dim oPic As Picture
        Me.Pictures.Visible = False
        With Range("B12")
            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
    
This code works for my output in cell B12 from the dropdown list in B11. Now 
I would like to do the same for my second dropdown list in C11, and would 
like to display it in C12. Both dropdown lists are coming from the same list 
named picTable on Sheet 2 as informed by your excel help. I can't seem to 
just duplicate the code and change the range on the second code. I'm guessing 
I have to nest the two codes into one code for that sheet? I don't know how 
to properly code this. Any help?

Thanks again, 
Mike

"Cutter" wrote:

> 
> Have you had a look at JE McGimsey's site:
> 
> http://www.mcgimpsey.com/excel/lookuppics.html
> 
> I think it is exactly what you're trying to do.
> 
> 
> -- 
> Cutter
> ------------------------------------------------------------------------
> Cutter's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=9848
> View this thread: http://www.excelforum.com/showthread.php?threadid=513797
> 
> 
0
2/22/2006 4:39:11 PM
Try this:

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("B12")
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
With Range("C12")
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

Make sure you change the formula in C12 to refer to the drop down list
in C11

And you'll have to do something to your lists so that the name for the
picture already showing (from one list selection) does not show up in
the other.  This is because each picture can only be shown once.  I
think you'll have to have 2 lists.


-- 
Cutter
------------------------------------------------------------------------
Cutter's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=9848
View this thread: http://www.excelforum.com/showthread.php?threadid=513797

0
2/23/2006 1:52:07 AM
Wonderful. Thank you Cutter, your codes work perfectly. This is exactly how I 
wanted it to work. I did make two seperate lists and associated two different 
pictures, and now I can select two of the same boats without losing the 
picture(even though the point is to compare two different boats). I 
definitely need some coding practice, but having someone to point you in the 
right direction helps. I would have been lost without the help. Thanks.

Thanks to Ron as well for your approach. My minimal experience with Macros 
made the approach a bit more complicated. It kept returning the text name of 
the picture instead of the picture itself. I'm sure it had to do with one of 
my definitions, or a small error with my code. But thanks for your input as 
well. 

Mike
"Cutter" wrote:

> 
> Try this:
> 
> Private Sub Worksheet_Calculate()
> Dim oPic As Picture
> Me.Pictures.Visible = False
> With Range("B12")
> 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
> With Range("C12")
> 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
> 
> Make sure you change the formula in C12 to refer to the drop down list
> in C11
> 
> And you'll have to do something to your lists so that the name for the
> picture already showing (from one list selection) does not show up in
> the other.  This is because each picture can only be shown once.  I
> think you'll have to have 2 lists.
> 
> 
> -- 
> Cutter
> ------------------------------------------------------------------------
> Cutter's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=9848
> View this thread: http://www.excelforum.com/showthread.php?threadid=513797
> 
> 
0
2/23/2006 2:37:31 PM
You're very welcome.  I'm a VBA novice myself so the real thanks fo
what I was able to give you goes to JE McGimpsey for writing th
original code and providing it to people like you and me in a way tha
we can understand it and get it working for our specific needs.

PS - Do I get a great deal on a boat?  ;-)

PPS - It would have to be an icebreaker if I do.  Canada, eh

--
Cutte
-----------------------------------------------------------------------
Cutter's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=984
View this thread: http://www.excelforum.com/showthread.php?threadid=51379

0
2/23/2006 9:23:32 PM
Hello,

I tried the method on the McGimpsey site, but it doesn't seem to work
in my case. Well, it does exactly what it is supposed to do I guess,
but I have other graphics on my sheet (another picture=a logo that
should stay fixed and a bunch of Combo boxes). Isn't there a way to
define a list of the photo's that should be hidden, rather then
everything on the page? The problem is that the "Me.Pictures.Visible =
False" command hides everything, including what should remain visible.
Help would be very much appreciated.

Kind regards,


-- 
Jufa
------------------------------------------------------------------------
Jufa's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=30742
View this thread: http://www.excelforum.com/showthread.php?threadid=513797

0
3/1/2006 9:40:05 AM
Hello Jufa

As I mentioned above, I'm not an expert in VBA but if you add a line t
the code shown on the McGimpsey site you can retain your logo.

Try this:

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
ActiveSheet.Shapes("Picture 8").Visible = True
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

Notice the added line: ActiveSheet.Shapes("Picture 8").Visible = True
(You could add additional lines right after it for other pictures yo
want retained)

This will keep Picture 8 visible at all times so add that line to you
code and use the name of your logo instead of Picture 

--
Cutte
-----------------------------------------------------------------------
Cutter's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=984
View this thread: http://www.excelforum.com/showthread.php?threadid=51379

0
3/2/2006 2:34:13 PM
Hey Cutter,
Thanks for your input. That should safeguard my logo, but I'm not too
sure about the dropdown boxes. They dissapear too.
However, I see other use for you line of code. it seems that if I use
your line, but define all pictures that can be triggered as a result of
my dropdown as ActiveSheet.Shapes("Picture 8").Visible = False and omit
the Me.Pictures.Visible = False line, I might get where I want to be.

Don't have time to test it right now. What I'm trying to do is actually
an "in between project". The basics are finished, but the fine-tuning is
for when my main monthly recurrent projects are finished. I just wanted
to say thanks right away though. I'll be in touch later to inform you
whether it worked, or ask more questions:)

So thanks and see you later.


-- 
Jufa
------------------------------------------------------------------------
Jufa's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=30742
View this thread: http://www.excelforum.com/showthread.php?threadid=513797

0
3/7/2006 2:14:06 PM
Hello all,

I used cutter's code-line to hide all pictures I do not want to see (13
flags, picture 25 through 37). However, when I select an item now in the
drop down list, I get a "Run-time error '13' Type mismatch. When I open
the debugger, the arrow points to "For Each oPic In Me.Pictures" Can
someone please have a look at my code and see what's wrong? I would
LOVE to get this thing working. I left out the line
"Me.Pictures.Visible = True" at the beginning as I see no use for it
since I define all pictures NOT to show. Many thanks in advance!

Private Sub Worksheet_Calculate()
Dim oPic As Picture
ActiveSheet.Shapes("Picture 25").Visible = False
ActiveSheet.Shapes("Picture 26").Visible = False
ActiveSheet.Shapes("Picture 27").Visible = False
ActiveSheet.Shapes("Picture 28").Visible = False
ActiveSheet.Shapes("Picture 29").Visible = False
ActiveSheet.Shapes("Picture 30").Visible = False
ActiveSheet.Shapes("Picture 31").Visible = False
ActiveSheet.Shapes("Picture 32").Visible = False
ActiveSheet.Shapes("Picture 33").Visible = False
ActiveSheet.Shapes("Picture 34").Visible = False
ActiveSheet.Shapes("Picture 35").Visible = False
ActiveSheet.Shapes("Picture 36").Visible = False
ActiveSheet.Shapes("Picture 37").Visible = False
With Range("E3")
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


-- 
Jufa
------------------------------------------------------------------------
Jufa's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=30742
View this thread: http://www.excelforum.com/showthread.php?threadid=513797

0
3/10/2006 4:01:16 PM
Hi Jufa

To use this method you have to define the pictures that you want to
show, not the ones that you want to hide.  If you have too many then
hopefully one of the VBA experts will jump in with an alternative
method.

The line you took out is needed because the line that is now causing
the error refers to it.  And note that the line you took out is:
Me.Pictures.Visible = False (Not =True) as you stated in your last post


-- 
Cutter
------------------------------------------------------------------------
Cutter's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=9848
View this thread: http://www.excelforum.com/showthread.php?threadid=513797

0
3/11/2006 10:23:52 PM
Hey Cutter,

I'm now using exactly your code (except for the cell reference which I
adjusted to my needs), but it keeps giving the error on the line "For
Each oPic In Me.pictures". I have no clue of what I'm doing wrong. When
I apply the same addition of code (ActiveSheet.Shapes("Picture
1").Visible = True) it works fine, it's just that in my sheet, the
error keeps popping up.

Can the problem be, that it says "For Each oPic in Me.Pictures" while
some pictures seem to be missing. For example. The pictures that are in
my look-up table are pictures 25-37. The numbers before that refer to
the logo and drop down boxes I guess. However, when I define those
first 24, I'm told that he doesn't recognise some of them and I have to
remove those numbers. I think this is due to the fact that while
originally setting up my sheet I deleted some pictures/drop down boxes
and added them again. Excel however, just keeps taking the next number
instead of recycling the nrs of the pics that were deleted. Can this be
causing my conflict and how can I solve this??

Kind regards,


-- 
Jufa
------------------------------------------------------------------------
Jufa's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=30742
View this thread: http://www.excelforum.com/showthread.php?threadid=513797

0
3/13/2006 3:21:42 PM
Let me see the code you're using.  Keep in mind that I'm not an expert
but I'll see if I can help.


-- 
Cutter
------------------------------------------------------------------------
Cutter's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=9848
View this thread: http://www.excelforum.com/showthread.php?threadid=513797

0
3/13/2006 4:37:32 PM
Hey Cutter,
First of all, thanks for all your help. I was using a regular combobox
like you mention, but maybe it's something in the settings (I use
placement 1) that identifies them like pictures?
Anyways, I started over and used data validation now instead of the
drop boxes and now it's working just fine. It looks a bit less
professional in my opinion, but it will have to do. It has been
distributed. I'm a financial analyst in the first place and I couldn't
keep spending time in cosmetics. I think somehow something in my
original sheet got messed up and the code SHOULD be working fine, but
it just isn't. Maybe for a learning proces I'll post it. This is the
most simple form, asking to keep the logo visible. I would have to add
a few more to keep the drop boxes. Again, thanks for your efforts. Best
of luck. I will still be checking out your comments though. I hate it
when things don't work the way I want them too and I might distribute
an update later:) It's the line "For Each oPic..." that seems to block
things.

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
ActiveSheet.Shapes("Picture 7").Visible = True
With Range("F3")
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


-- 
Jufa
------------------------------------------------------------------------
Jufa's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=30742
View this thread: http://www.excelforum.com/showthread.php?threadid=513797

0
3/15/2006 1:27:10 PM
Hi Cutter is it possible to do this the other way around and have the 
pictures themselves be in the drop down? I have many parts to choose from and 
a person in the field probably won't know what the part number is but they 
will be able to look at the part. It would be great if they were able to pick 
it out from a list of pictures and then have the part number displayed in a 
cell next to it.

Sorry to jump in like this but I haven't been able to get any response on 
whether or not this is possible and whom to talk to. ANY help would be much 
appreciated!

Thanks in advance.

"Cutter" wrote:

> 
> Let me see the code you're using.  Keep in mind that I'm not an expert
> but I'll see if I can help.
> 
> 
> -- 
> Cutter
> ------------------------------------------------------------------------
> Cutter's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=9848
> View this thread: http://www.excelforum.com/showthread.php?threadid=513797
> 
> 
0
JonO (8)
3/21/2006 3:01:30 PM
Jono

I doubt that it's possible.  I've never heard of it being done (or eve
heard of anyone asking for it until now).  But you'd have to hear fro
the VBA experts for a definite answer.

Cutte

--
Cutte
-----------------------------------------------------------------------
Cutter's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=984
View this thread: http://www.excelforum.com/showthread.php?threadid=51379

0
3/21/2006 3:40:56 PM
Thank you, thank you , thank you! Finally an answer.
I'll try that group.

"Cutter" wrote:

> 
> Jono
> 
> I doubt that it's possible.  I've never heard of it being done (or even
> heard of anyone asking for it until now).  But you'd have to hear from
> the VBA experts for a definite answer.
> 
> Cutter
> 
> 
> -- 
> Cutter
> ------------------------------------------------------------------------
> Cutter's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=9848
> View this thread: http://www.excelforum.com/showthread.php?threadid=513797
> 
> 
0
JonO (8)
3/21/2006 3:57:28 PM
One thing you might consider, is to put the images in the comment boxes of
each cell with the description therein, the pictures pop up as you mouse
over the cell.......

hth
Vaya con Dios,
Chuck, CABGx3


"Jono" <Jono@discussions.microsoft.com> wrote in message
news:912CC438-6A9B-4342-832A-7ACAD66C68F7@microsoft.com...
> Hi Cutter is it possible to do this the other way around and have the
> pictures themselves be in the drop down? I have many parts to choose from
and
> a person in the field probably won't know what the part number is but they
> will be able to look at the part. It would be great if they were able to
pick
> it out from a list of pictures and then have the part number displayed in
a
> cell next to it.
>
> Sorry to jump in like this but I haven't been able to get any response on
> whether or not this is possible and whom to talk to. ANY help would be
much
> appreciated!
>
> Thanks in advance.
>
> "Cutter" wrote:
>
> >
> > Let me see the code you're using.  Keep in mind that I'm not an expert
> > but I'll see if I can help.
> >
> >
> > --
> > Cutter
> > ------------------------------------------------------------------------
> > Cutter's Profile:
http://www.excelforum.com/member.php?action=getinfo&userid=9848
> > View this thread:
http://www.excelforum.com/showthread.php?threadid=513797
> >
> >


0
croberts (1377)
3/22/2006 1:14:51 AM
Reply:

Similar Artilces:

How do I insert Roman Numerals?
New to Word 2007 would someone please explain to me how to insert Roman Numerlas in my document? "ckj" <ckj@discussions.microsoft.com> wrote in message news:6CF0C580-BA6E-463D-B4FD-E6A6FDD9E814@microsoft.com... > New to Word 2007 would someone please explain to me how to insert Roman > Numerlas in my document? Just type them... I II III IV V VI VII VIII IX X XI etc etc. Type a number e.g. 21, select it and run the following macro Dim oRng As Range Set oRng = Selection.Range oRng.Fields.Add oRng, 34, oRng.Text & " \*Roman"...

Lookup selective from another sheet
Assume I have one sheet as below. How can I create a new sheet and display only those entrys that are greater than a entered value. i.e main sheet abc 2 def 5 ghi 6 jkl 5 fgh 3 krk 4 on second sheet, if 4 is entered only entrys >4 are shown. i.e def 5 ghi 6 jkl 5 krk 4 Try something like this: C1=IF(VLOOKUP(A1,Sheet2!A$1:B$4,2,FALSE)>Sheet1!B1,VLOOKUP(Sheet2!A$1:B$4,2,FALSE),NA()) Your main sheet is A1-b6 and Sheet 2 is A1:B4 "Jim" <Jim Forrest@hotmail.com> wrote in message news:WBb4f.34203$U9.12412@fe3.news.blueyonder.co.uk... > Assume...

Insert trigger
Looking for some advice on SQL 2005. I have a table that will usually be populated by an SSIS package. I want to set the "loaddate" column to the current time after a record is inserted. Should i do this via trigger or should i just build a step in the SSIS package to update the column after the file loads? If trigger is the way to go, what is the syntax to create the after insert trigger? Thanks in advance. You can create a default constraint on the table set to CURRENT_TIMESTAMP. That will handle the automatic date assignment without any need for coding. -...

inserting hrs and minutes
I have a cell in my time card that displays total weekly time -ex- "40:15" is there a way to make it more like this...40hrs,15mins -- Message posted from http://www.ExcelForum.com Use a custom format hh"hrs",mm"mins" -- Regards, Peo Sjoblom "-Brian-H- >" <<Brian-H-.110wgs@excelforum-nospam.com> wrote in message news:Brian-H-.110wgs@excelforum-nospam.com... > I have a cell in my time card that displays total weekly time -ex- > "40:15" is there a way to make it more like this...40hrs,15mins ? > > > ...

Unstable view
This is a multi-part message in MIME format. ------=_NextPart_000_0021_01C76D6F.4A95FED0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Each time I select another item at the bottom of the list, the listbox always move the scrollbar itself to redisplay the list and see the first selected item. I always have to move the scrollbar again to go far down at the bottom of the list to be able to select another item... Did I miss something to do, with this ListBox? jmarc... ------=_NextPart_000_0021_01C76D6F.4A95FED0 Content-Type: text/html; ...

insert an interactive excel file into word web page
I'm trying to insert a excel file into a word document with text, and then save it was as a web page, but I want to keep the excel part interactive. Any ideas? ...

Insert | File > Attachmnet-Button Drop Down ;What is the difference between Insert and Insert As Attachmnet
re: "Outlook2003, File-Insert-Options" On making new-email with Attachment-File(s), ** File Menu | Insert | File >>> (Brows and select File to insert ) then we can see the button "Insert", and write side Drop Down Arrow lower-right side of Dialog Box; If it clicked, we can see three options as follows: ** Insert Insert as text Insert as Attachment I can not recognize/understand the difference between "Insert" and "Insert as Attachment" *** What is the difference between Insert and Insert As Attachment ? I would appreciate y...

Change page orientation to suit selection
I have a macro to quickly print the selection. In order to get the maximum sized print, I would like to change page orientation to maximise it. Is there any way to find the size of the selection so I can get the height / width ratio? You might not have ever noticed, but the row height and column width in Excel are not measured to the same standard. Don't ask me why, because I don't know other than two different people came up with the idea of how to measure them. The standard row height is 12.75 and the standard column width is 8.43, yet when you look at the wo...

Inserting Hyperlinks in a Protected Sheet
Hi I run Excel 2000 and I have a protected worksheet that I share wit users in my organisation. I want to allow the insertion of a hyperlin to a specific file type within a specified directory on our server. 3 Questions: 1.Protection on disables the insert hyperlink command. Can this b overcome with worksheet activate code? 2.Can I limit the types of files (preferably by requiring the file t meet a mask format eg "z-*.xls")? 3.Can I limit the directory that can be linked, by referring to pathname stored in a cell on the active sheet? Would appreciate your suggestions. Thanks S...

Insert with a where condition
Hi, sql 2005 I have an insert statement that is ignoring the where condition. That is, I want to insert records when they do not already exist in the destination table. INSERT INTO dbo.tblmnuGroupPerm ( gId ,mtfID ,... ) SELECT @gID ,mtfID ,... FROM dbo.locmnuTabFunction AS ltf WHERE ltf.mtfID NOT IN ( SELECT gp.mtfID FROM dbo.tblmnuGroupPerm AS gp WHERE gp.gId=@gID AND gp.Deleted=0 ) Any ideas or recommendations appreciated :-) Many thanks, Jonathan It's OK... <oops "redFace">I did not correctly se...

Insert
I want to overtype in a Publisher text box. I find I can only insert. The "insert" key doesn't do anything. ...

Print Selected Record
I want to print a popup form. I used the command button wizzard to set up a button to print the form. How can I filter what's printed to be only the selected (active) record? -- Thanks. Sammie Access 2003 Although allowed, Forms are really not designed for printing. Why not just create a report to present the data for the current record. Then you can use the Where argument of the OpenReport method to have the report limited to the active record on the form? -- Dave Hargis, Microsoft Access MVP "Sammie" wrote: > I want to print a popup form. I used the command...

limit one list box data set based on selection in another list box
I am using Access 2k to resolve a form problem where multiple list boxes are partially dependant on the value(s) in other list boxes. I keep reading that an unbound list box can be populated with data from the value of another list box, but how to do it is not explained. I have Vendors, Mfr, and ProductLines with list boxes for each. A vendor supplies the manufacturer's product lines. What I want to have done is the mfr list and productline list fill in the appropriate (related) data based on the vendor. The tables are normalized and all the key values are present (vendorid, mfrId, PL...

Saving pictures as trasparent
Hello! Having problems when I'm having two pictures in my file. The first one is a background, and the second one should be transparent. How do I do that? Thanks -- - Lars I would suggest the version of Publisher you are using does not support transparency. -- The US should free all those illegally held prisoners they are torturing, abusing and denying human rights being held at Guantanamo Bay. We have the 2003 version of publisher. Should the picture be created transparent before pub? -- - Lars "���MS�Publisher���" <donotknock@nobodyhome.com> wrote i...

Selective Internet Access
Recently, my internet access for Internet Explorer and other programs was shut off. At first I thought it was a virus, but then I realized that some programs have access and some do not. Here is a list: Program that have internet Access: Thunderbird, Firefox, Active Sync, Teamviewer, Logmein, Avira Programs that Don't have internet Access: Internet Explorer, Napster, Rhapsody, Symantec Live Update, Google Chrome, Opera I don't think it'd a virus, but I'm not sure. Any suggestions would be greatly appreciated. Thanks in advance! Chaz Asked/Answered...

Dropdown Font Size
I'm using a List in Data Validation, & the dropdown shows a very small Font Size, even though after a selection is made, the Font displayed is fine. Is there a way to "expand" the Font Size in the Dropdown? TIA - Bob I've searched - Debra has a workaround... Thanks - Bob "Bob Barnes" wrote: > I'm using a List in Data Validation, & the dropdown shows a very small Font > Size, even though after a selection is made, the Font displayed is fine. > > Is there a way to "expand" the Font Size in the Dropdown? > > TIA - Bob ...

how to insert data in a table
Hi Exprets; I am creating an access database in which I want to insert data in already created table. Kindly help. Regards, Vikky Vikky <love.excel@gmail.com> wrote in news:1194124711.012302.269990 @e34g2000pro.googlegroups.com: > Hi Exprets; > > I am creating an access database in which I want to insert data in > already created table. > > Kindly help. > > Regards, > > Vikky > Data from where? Do you want to import it from excel, from a text file, copy it from another table or type it in manually? -- Bob Quintal PA is y I've altere...

How do you insert page numbers larger than 1000?
I have my purchase orders set up as a Publisher document. When our organization upgraded from Publisher 2000 to Publisher 2002, the new version set parameters on the page numbers. This was one of those things that worked just fine in the previous version... Does anyone know how to turn it off or change it? Hi mregen (mregen@discussions.microsoft.com), in the newsgroups you posted: || I have my purchase orders set up as a Publisher document. When our || organization upgraded from Publisher 2000 to Publisher 2002, the new || version set parameters on the page numbers. This was one of those...

Picture in Outlook
I just tried to put an Enhanced Metafile picture into and outlook message and when it was received, the picture had changed to a bitmap. Can someone explain why this happens and what needs to be done to ensure it doesn't happen again? Thanks ...

double picture files
How can I find double picture files in MS Office picture database ? ...

Select alternate rows to copy
I would like to select alternate rows within a range on a worksheet to copy to another sheet. Any ideas on how to do this? -- Christina Christina Use a spare column (I used B but any will do), enter this formula and copy down to the full extent of your data. You will get alternating TRUE, FALSE =MOD(ROW(A2),2)=0 Now invoke an autofilter (Data>Filter>Autofilter) and filter on which one you want. Copy that data and pate to another sheet. -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England nick_hodgeTAKETHISOUT@zen.co.uk.ANDTHIS "Christina" <Christina@disc...

insert downloads into power point
i downloaded an application called "BioDigital Simulator" of an animated cleft lip/palate surgery and need it put into my power point presentation, but can't fiugre out how to do so.... very frustrating... What kind of file is this application? Is it a video? If so, what kind? MPEG? AVI? MOV? Or is it an EXE file? Something else? Which version of PPT are you using? -- Echo [MS PPT MVP] http://www.echosvoice.com What's new in PPT 2010? http://www.echosvoice.com/2010.htm Fixing PowerPoint Annoyances http://tinyurl.com/36grcd PowerPoint 2007 Complete Makeover...

Insert dataset to another database
I'm posting this to this group also since it pertains to queries, primarily. Hello, Using VB6/ADO, I'm thinking I can create a recordset and insert it into another table in a different Jet database, all within the execution of a single query. But, I can't seem to get it to work, even in an experiment in Access 2K. My sql in Access 2K: SELECT D.lorder as Ord, A.Lorder FROM [;Database = C:\MyDocuments\Acc2K\Wrk.mdb].OrdersData as A INNER JOIN [;Database = C:\Access\Work\Sales06.mdb].Detl1 as D On D.Lorder = a.lorder WHERE ((D.fg)= 'MXX-NC' Or (D.fg)= 'MXX.NC')...

Insert a blank row
Hi, I need some help to insert a blank row in a range where column A has a series of dates. There will be several of the same dates and I need to both sort the dates and then insert the blank row at the end of each sequence. In the blank row I need to total figures that will be in columns B through to G. Thanks, Jim S Hi Jim maybe an easier solution 1. Sort your data (use 'Data - Sort', e.g., column A ascending) 2. Use 'Data - Subtotals' This will insert a row after each date and calculate subtotals automatically for you HTH Frank anon wrote: > Hi, > I need some...

How do I insert a letter into an existing word document?
I am working on a large document that I need to add several letters that are on our letterhead. If I cut and paste the letter, the letterhead header becomes skewed. This is just one issue I'm having with the document! Also need to know how to merge 3 separate documents together once I insert the letters that I need! Help! What do you mean by "skewed"? To preserve the data from the header of the document, you will need to insert it into a Section of its own separated from the rest of the document by Next page Section breaks before and after it with the headers...