Conditionally display an object in a cell ?

  • Thread starter Thread starter Mark Parent
  • Start date Start date
M

Mark Parent

I can check a cell's contents using IF and display
particular text "YES" or "NO" depending in the result.
To make my spreadsheet more 'attractive' I'd like to
display a specific drawn item instead of simple text.

Is this possible ? I think it would require that I
store the drawn object in a cell, but I don't know how to
do that.

Thanks in advance to anyone with a suggestion.
 
Insert the picture on your worksheet. Then
load this macro to hide it:

Sub Hide_It()
ActiveSheet.Shapes("Picture 1").Visible = False
End Sub

Press Alt+F11, click on the ThisWorkbook module for your
file, insert the code above, and run it. Then click on the
appropriate sheet module and insert this code:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Count > 1 Then Exit Sub
With Range("H3")
If .Value > 100 Then
ActiveSheet.Shapes("Picture 1").Visible = True
End If
End With
End Sub

--
The example above will display the picture when H3 changes
to greater than 100.

HTH
Jason
Atlanta, GA
 
Graphical items ride in a layer over the excel grid and
not in cells -- so you really don't store pictures in
cells. You can use conditional formats to change the cell
color/shade ...

(e-mail address removed)
-----------------------------------------------------------
 
Back
Top