Can I include a picture in a formula i.e. if cell a26 >90% then s.

C

chrstrcy

Nope, still not working - that's why I thought the cell needed to be
specified - at a loss at this point. Thanks so much for your continued help.
 
D

Dave Peterson

Maybe it's time to describe what you really want and post the current version of
your code.
Nope, still not working - that's why I thought the cell needed to be
specified - at a loss at this point. Thanks so much for your continued help.
 
C

chrstrcy

Ok, here goes:

I have an excel spreadsheet that I am creating to be a Quote for our sales
people. On the top in cell A1 I have our company logo and on the bottom I
have a data validation box (list box) with all the Sales Persons names in it.
Currently when I change the name using the list box that persons
signature(picture) pops up accordingly; however, everytime I change the
salespersons name in the list box the appropriate signature is displayed but
the logo disappears. I keep inserting the Logo back into cell A1, reviewing
the code as you last gave me and change the name in the list box and the logo
disappears once again. I have tried also putting Picture 1 in my PicTable as
well as leaving it out but to no avail. Code is as follows currently:

Option Explicit
Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Me.Range("A66")
For Each oPic In Me.Pictures
If LCase(oPic.Name) = LCase("Picture 1") Then
'show it
oPic.Visible = True
Else
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Exit For
End If
End If '
Next oPic
End With
End Sub
 
D

Dave Peterson

First, I'd wouldn't use the worksheet_Calculate event.

I'd use the worksheet_Change event. But if you're using xl97, then this won't
work correctly. (I'm gonna assume that you're using xl2k or higher.)

I'd use:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)

Dim oPic As Picture
Me.Pictures.Visible = False
With Me.Range("A66")
For Each oPic In Me.Pictures
If LCase(oPic.Name) = LCase("Picture 1") Then
'show it
oPic.Visible = True
Else
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Exit For
End If
End If
Next oPic
End With
End Sub

But if you're adding that logo picture back each time, you have lots of pictures
named "Picture 1" (well, if you changed the picture correctly.

I'd unhide all the pictures and delete those extra logo pictures.

And I don't see anything that's stopping the logo from being shown. My guess
(still!) is that it isn't named "Picture 1".

Are you sure that's what you named it?

Ok, here goes:

I have an excel spreadsheet that I am creating to be a Quote for our sales
people. On the top in cell A1 I have our company logo and on the bottom I
have a data validation box (list box) with all the Sales Persons names in it.
Currently when I change the name using the list box that persons
signature(picture) pops up accordingly; however, everytime I change the
salespersons name in the list box the appropriate signature is displayed but
the logo disappears. I keep inserting the Logo back into cell A1, reviewing
the code as you last gave me and change the name in the list box and the logo
disappears once again. I have tried also putting Picture 1 in my PicTable as
well as leaving it out but to no avail. Code is as follows currently:

Option Explicit
Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Me.Range("A66")
For Each oPic In Me.Pictures
If LCase(oPic.Name) = LCase("Picture 1") Then
'show it
oPic.Visible = True
Else
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Exit For
End If
End If '
Next oPic
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top