Take a look at this website:
http://www.mcgimpsey.com/excel/lookuppics.html
And if that code doesn't suffice, try this code:
'Private Sub Worksheet_Calculate()
'Calls the Named Ranges needed for the code to run
Dim myCell As Range
Dim mySel As Range
'Sets dimension to center pictures within cell
Dim myR As Range
Dim myP As Shape
Set mySel = Selection
With Application
.ScreenUpdating = False
'Checks first to see if a cell within the named range is blank, skips if it is, and calls the appropriate image if not
On Error Resume Next
For Each myCell In Range("KeyCells")
If myCell <> "" Then
'Deletes old image and replaces it with the called new one
ActiveSheet.Shapes(myCell.Address & "Final").Delete
ActiveSheet.Shapes(myCell.Value).Select
Selection.Copy
myCell.Offset(0, 0).Select
ActiveSheet.Paste
Selection.Name = myCell.Address & "Final"
Selection.ShapeRange.ZOrder msoSendToBack
'Centers pictures within cell
With Selection
Set myR = .TopLeftCell
.Left = myR.Left + (myR.Width - .Width) / 2
.Top = myR.Top + (myR.Height - .Height) / 2
End With
Else: ActiveSheet.Shapes(myCell.Address & "Final").Delete
GoTo Skip
End If
Skip:
Next myCell
mySel.Select
.ScreenUpdating = True
End With
End Sub
The size of the image will be the same size that you set the initial image to.
Bookmarks