Image Named Range

  • Thread starter Thread starter NPell
  • Start date Start date
N

NPell

Hello,

I have a problem with Named Ranges for Images in Excel.
I can get an image to display a cell reference. Thats no problem.

But i want an image to display an image.
As it sounds now - you're probably thinking "Just copy the image?"
But it is because i want them to show during different scenarios.

IE.
If "Figure" < "Target" show "UnderTargetImage".
If "Figure" = "Target" show "OnTargetImage".
If "Figure" > "Target" show "OverTargetImage".

That sort of thing. The main images are held on a separate sheet,
called "Data" (Along with graph data etc).
Is this possible??

Regards,
 
Here is one I use (probably can be vastly improved) that has named shapes on
another sheet that is selected using a drop down. Modify to suit

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A1")) Is Nothing Then
Dim Shp As Shape
On Error GoTo PictureNotFound
Worksheets("Sheet1").Shapes(Me.Range("A1").Value).Copy
'Worksheets("Sheet1").Shapes("don1").Copy

'Delete the previous picture
For Each Shp In Me.Shapes
If Shp.Type = msoPicture Then
If Shp.TopLeftCell.Address = "$C$1" Then
If Shp.Name <> Range("A1").Value Then Shp.Delete
End If
End If
Next
Worksheets("Sheet2").Paste
With Selection
.Name = Range("A1").Value
.Top = Range("C1").Top
.Left = Range("C1").Left
End With
Range("A1").Select
Exit Sub
PictureNotFound: MsgBox "Picture not found!" & vbNewLine _
& "Check Name."
End If
End Sub
 
Back
Top