View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default VBA on vlookup picture.

Yesterday when you posted the same question, Dave P gave you some revised
code.

You said it worked, but I tried it and could get different pictures to
display by adding another DV dropdown to A3 and a VLOOKUP formula in H9, but
not the same picture in both F1 and H9.

Is that the problem you are having?

Got to Debra Dalgeish's site for a sample workbook from Bernie Dietrick for
adding pictures to selections.

Alows for more than one picture(or same picture multiple times) to be
displayed based upon a value or item chosen from DV lists

http://www.contextures.on.ca/excelfiles.html#DataVal

DV0049 - ClipArt Selection

Edit the code to suit.


Gord Dibben MS Excel MVP

On Thu, 6 Nov 2008 08:24:00 -0800, Oligo wrote:

hi according to the below link method, how can i use the picture again for
another cell range? and if both cell range input is same. how can i display
two same picture with my picture data?


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


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