View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Max321 Max321 is offline
external usenet poster
 
Posts: 2
Default Display image based on value/status

Hi,

I have a workbook with a "frontpage" containing dials (10 of them) to show
the status of a number of Indicators, i.e. Off Track/Warning/On Track.
I've successfully used the tip on
http://www.mcgimpsey.com/excel/lookuppics.html
to show the correct dial based on value/status in another worksheet, but how
can I change it to be used in several cells in the same worksheet?

The VB part on that page is "hard coded" (as far as I can understand - no VB
expert) to only display the image in 1 specific cell.

Also how would I go about centralizing the image in the cells?

Code used -
--------
Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("C7") <----------------- Hard coded cell ID.
For Each oPic In Me.Pictures
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Exit For
End If
Next oPic
End With
End Sub
-------

Many Thanks!

- Max