Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Skonnoth
 
Posts: n/a
Default use pull down menu to select a picture

I use the Combo Box pull down menu buttons a lot.
I click on the Box, select an item from the list and the relevant data pops
up as expected. How can I make a picture pop up when I select an item from
the Combo Box List?

please advise

  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

I think you would need VBA.The picture would not be in the cell, as shapes
exist in a separate layer to the worksheet cells, but you could position it.

What you could do is name the logo by the value in the drop-down, and then
move that to the required position, move all others away.

The problem is that when you select something, you need a way to align that
selection to the picture object. That is what I was suggesting was a method
of aligning them. What I mean is that if the entry in the drop-down is say
'Mercury Inc' then name the picture with that same value. But you still
don't get it move automatically, you need to write some code to do that.
This worksheet event code will do it assuming that the drop-down is
DataValidation

Private Sub Worksheet_Change(ByVal Target As Range)
Dim sh As Shape
Application.EnableEvents = False
On Error GoTo ws_exit
If Not Intersect(Target, Range("A13")) Is Nothing Then
With Target
If .Value < "" Then
For Each sh In ActiveSheet.Shapes
sh.Left = 5000
Next sh
With ActiveSheet.Shapes(.Value)
.Left = 100
.Top = 100
End With
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

On the worksheet that you want the pictures, right-click on the sheet tab.
This will bring up a menu, select View Code from the menu, and this will
open up the VBA with the worksheet code module opened up. Paste that code
into there. If you drop-down is not in A13, change that part of the code to
suit.

Go back to Excel, load your pictures into the sheet, load the drop-down
list, then select something. You may then want to tune where the picture
moves to.



--
HTH

Bob Phillips

"Skonnoth" wrote in message
...
I use the Combo Box pull down menu buttons a lot.
I click on the Box, select an item from the list and the relevant data

pops
up as expected. How can I make a picture pop up when I select an item from
the Combo Box List?

please advise



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
insert picture BillGwyer Excel Discussion (Misc queries) 1 March 4th 05 06:37 PM
External Data to be used as in a pull down menu in Excel2003 keith perdue via OfficeKB.com Excel Discussion (Misc queries) 1 January 26th 05 02:39 PM
Dynamic Formulas with Dynamic Ranges Ralph Howarth Excel Worksheet Functions 5 January 21st 05 08:44 AM
Menu items added with menu item editor in older versions Michael Hoffmann Excel Discussion (Misc queries) 2 January 7th 05 01:40 PM
When I select "Open" from the "File" menu in Excel, I get only a . dan Excel Discussion (Misc queries) 1 November 30th 04 11:25 PM


All times are GMT +1. The time now is 02:32 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"