View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Dave B Dave B is offline
external usenet poster
 
Posts: 12
Default Cell Shading from a Bit Map image

Oh, I see that now in the macro (told you I was a "Newby" to VBA programming,
used to do lots of Lotus macros back in the 2.2 days, yes.. I'm old).

Anyway, help me understand just a couple of more points,

1) the command me.pictures.visible; is this a macro statement or is it a
name? I was not able to find the name me.picutures. If this is not a macro
command, how is the name generated?

2) is the stament oPic a macro statement? (basically the same question as
above)

3) I have only recently generated my first macro (and I used the record
feature to do it). It appears the event macros are entered using the VBA
editor. I am planning to enter the statements as they are presented in the
illustration. Is it possible then to add the recorded macro directly behind
the picture look up macro.

Thanks for your advice and patience!
--
Dave B


"Gord Dibben" wrote:

Dave

The pictures in JE's sample workbook are just hidden on the sheet.

From JE's site....................

The Worksheet_Calculation event is then used to place the picture on top of cell
F1, hiding the formula. The event macro is placed in the worksheet code module,
where it will fire each time a calculation occurs on the sheet. The macro hides
all the pictures, then displays the one corresponding to the value in F1,
repositioning it if necessary.

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False 'all pictures get hidden
With Range("F1")
For Each oPic In Me.Pictures
If oPic.Name = .Text Then
oPic.Visible = True 'just the picture returned by the
'lookup formula
oPic.Top = .Top
oPic.Left = .Left
Exit For
End If
Next oPic
End With
End Sub

To see all the pictures change Me.Pictures.Visible = False to True


Gord
On Fri, 15 Dec 2006 18:10:00 -0800, Dave B
wrote:

Gord, Thanks for the link. This is exactly what I want to do. I downloaded
the sample and understand almost everything that is going on except.. where
are the pictures located. They aren't on a seperate sheet anywhere. They
have to be in the excel file, but I can find them.

If you are curious, you may wish to download the file. You will see what I
mean.

Anyway, I'll keep looking, thanks for your help

Best Regards,


Gord Dibben MS Excel MVP