Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Select a picture according to a selection on a dropdown box
Hello,
I have made three pictures out of autoshapes on one sheet (this will be hidden from the user). I would like to have another sheet where one of these pictures is displayed according to a selection in a dropdown box. So, if the user selects Group 1, I would like picture 1 to be displayed. If they select Group 2, I would like picture 2 to be displayed instead and so on. Is this do-able? I am not very confident with VB but have recorded some macros in the past. Thanks a lot for your help in advance. -- Johanna G |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Select a picture according to a selection on a dropdown box
In it's simplest form here is some code that should get you started. It
detects changes in cell A1 and grabs shapes from sheet1 an dpastes them onto the sheet with the code in it. This code must go inside the sheet. Right click the sheet tab and select view code. Paste the following... Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$A$1" Then Select Case Target.Value Case "Round" On Error Resume Next Me.Shapes(1).Delete On Error GoTo 0 Sheet1.Shapes("Oval 2").Copy 'Shape named oval 2 on sheet1 Me.Paste Case "Square" On Error Resume Next Me.Shapes(1).Delete On Error GoTo 0 Sheet1.Shapes("Rectangle 1").Copy 'Shape named rectangle 1 Me.Paste End Select End If End Sub -- HTH... Jim Thomlinson "Johanna Gronlund" wrote: Hello, I have made three pictures out of autoshapes on one sheet (this will be hidden from the user). I would like to have another sheet where one of these pictures is displayed according to a selection in a dropdown box. So, if the user selects Group 1, I would like picture 1 to be displayed. If they select Group 2, I would like picture 2 to be displayed instead and so on. Is this do-able? I am not very confident with VB but have recorded some macros in the past. Thanks a lot for your help in advance. -- Johanna G |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Select a picture according to a selection on a dropdown box
To have a picture show up based on VLOOKUP when you select an item from a DV
list or type in a name see JE MCGimpsey's site. 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. But that will pose no problem...........simply cut and paste the shapes to the sheet in which you want them to be displayed. Or 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 Fri, 29 Jan 2010 06:21:01 -0800, Johanna Gronlund wrote: Hello, I have made three pictures out of autoshapes on one sheet (this will be hidden from the user). I would like to have another sheet where one of these pictures is displayed according to a selection in a dropdown box. So, if the user selects Group 1, I would like picture 1 to be displayed. If they select Group 2, I would like picture 2 to be displayed instead and so on. Is this do-able? I am not very confident with VB but have recorded some macros in the past. Thanks a lot for your help in advance. |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Select a picture according to a selection on a dropdown box
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Dropdown selection by keyboard | Excel Worksheet Functions | |||
Dropdown selection by keyboard | Excel Worksheet Functions | |||
How do I allow a multiple selection from a dropdown? | Excel Discussion (Misc queries) | |||
Insert Picture from dropdown selection | New Users to Excel | |||
Dropdown list key selection | Excel Discussion (Misc queries) |