Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Quite a simple one here, but I guess the answer will be a resounding no!

I have a few symbols, basic clip-art, which I'd like to display depending on certain information.

At the moment, I'm using this statement to display Y or N:

=IF(B2>0,VLOOKUP(B2,'Student Data'!$A$2:$L$36,8),"")

It's a simple lookup which checks another worksheet to see if someone has entered "Y" or "N" into the relevant column.

What I'm wondering is this: would it be possible to display these clip-art images (I have them in .PNG format) instead of simple text? I.e. IF VALUE_OF_CELL=7, DISPLAY IMAGE1.

Thanks in advance,

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You could do this with a macro and setup your list of images with a select case statement if you want multiple images Here is one example for one image.

Sub imageConditionally)
  If ActiveCell.Value = 7 Then
  ActiveCell.Worksheet.Pictures.Insert ("http://www.gravatar.com/avatar/db65e70ba85d47e867af6c9451e7ec03?s=32&d=identicon&r=PG")
  Else:
    Dim shape As Excel.shape
     imgTop = ActiveCell.Top
     imgLeft = ActiveCell.Left
    For Each shape In ActiveSheet.Shapes
     If shape.Top = imgTop And shape.Left = imgLeft Then shape.Delete
    Next

  End If
End Sub

You might call this on the selection change checking whether the active cell was in the column you want this in or something

updated this example The previous example deleted ALL shapes on the worksheet, this should delete only the image positioned over the active cell.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.