View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
davesexcel davesexcel is offline
external usenet poster
 
Posts: 1
Default Toggling Visibility of items with VBA


There is a way to insert an image by selecting an item in a dropdown
menu

I cannot find the place I found the example so I will have to go by
memory, I know it was a MVP site and I am sure it was JD M....
but I can't locate it

-Open a new workbook
-insert three or four images anywhere in sheet 1
-enter this code into sheet 1's worksheet module
Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
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

sheet 2 enter this list

columnA Column B
selection 1 Picture 1
selection 2 Picture 2
selection 3 Picture 3

Name the range PicTable

go back to sheet 1

Select sheet1 A2
goto DATA,Validation, list
in th source box enter this formula

=offset(PicTable,,,,1)

select sheet1 F1 and enter this function

=VLOOKUP(A2,PicTable,2,FALSE)

hoping this helps you out...


+-------------------------------------------------------------------+
|Filename: Select BullNose.zip |
|Download: http://www.excelforum.com/attachment.php?postid=4966 |
+-------------------------------------------------------------------+

--
davesexcel


------------------------------------------------------------------------
davesexcel's Profile: http://www.excelforum.com/member.php...o&userid=31708
View this thread: http://www.excelforum.com/showthread...hreadid=557674