Conditional Pictures

  • Thread starter Thread starter kraljb
  • Start date Start date
K

kraljb

Does anyone know how to have pictures show or not show in a spreadshee
based upon data in the sheet?

Is there a way to do this with only using excel functions? Or do I hav
to use VBA code to do something like this?

Thanks,
Joh
 
Hi
for this VBA (using an event procedure) is required. e.g. put this code
in your worksheet module:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Address(False, False) = "A1" Then
If .Value <> "" Then
Application.EnableEvents = False
.Offset(0, 1).Select
Me.Pictures.Insert ("D:\Temp\image.jpg")
Application.EnableEvents = True
End If
End If
End With
End Sub

This inserts a picture (image.jpg) if you enter anything in cell A1

You may also consider using just a hyperlink to your image. This could
easily achieved with the HYPERLINK formula
 
Back
Top