ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Can I include a picture in a formula i.e. if cell a26 >90% then s. (https://www.excelbanter.com/excel-discussion-misc-queries/11118-can-i-include-picture-formula-i-e-if-cell-a26-%3E90%25-then-s.html)

PACF

Can I include a picture in a formula i.e. if cell a26 >90% then s.
 
Can I include a picture in a formula i.e. if cell a26 90% then show picture
x, if less then show picture y?...

Dave Peterson

Maybe you could do something like JE McGimpsey does at:
http://www.mcgimpsey.com/excel/lookuppics.html

PACF wrote:

Can I include a picture in a formula i.e. if cell a26 90% then show picture
x, if less then show picture y?...


--

Dave Peterson

Gord Dibben

PACF

Not a formula, but using worksheet event code.

See JE McGimpsey's site for code and instructions.

http://www.mcgimpsey.com/excel/lookuppics.html


Gord Dibben Excel MVP

On Wed, 2 Feb 2005 02:43:05 -0800, "PACF"
wrote:

Can I include a picture in a formula i.e. if cell a26 90% then show picture
x, if less then show picture y?...



PACF01

Many thanks - just what I needxed.

Paul


"Gord Dibben" wrote:

PACF

Not a formula, but using worksheet event code.

See JE McGimpsey's site for code and instructions.

http://www.mcgimpsey.com/excel/lookuppics.html


Gord Dibben Excel MVP

On Wed, 2 Feb 2005 02:43:05 -0800, "PACF"
wrote:

Can I include a picture in a formula i.e. if cell a26 90% then show picture
x, if less then show picture y?...




PACF

Many thanks - just what I'm llooking for.

Paul

"Dave Peterson" wrote:

Maybe you could do something like JE McGimpsey does at:
http://www.mcgimpsey.com/excel/lookuppics.html

PACF wrote:

Can I include a picture in a formula i.e. if cell a26 90% then show picture
x, if less then show picture y?...


--

Dave Peterson


Iriemon

Can I include a picture in a formula i.e. if cell a26 90% the
 
I can't figure out how to insert the pictures? HELP. I can modify the
PicTable on sheet 2 to expand the name range but I haven't been successful in
loading the pictures.

"Dave Peterson" wrote:

Maybe you could do something like JE McGimpsey does at:
http://www.mcgimpsey.com/excel/lookuppics.html

PACF wrote:

Can I include a picture in a formula i.e. if cell a26 90% then show picture
x, if less then show picture y?...


--

Dave Peterson


Dave Peterson

Can I include a picture in a formula i.e. if cell a26 90% the
 
JE's routine assumes that the pictures are already on the worksheet.

So load your pictures manually (or anyway you know), then use JE's code to
hide/show the ones you want.

Iriemon wrote:

I can't figure out how to insert the pictures? HELP. I can modify the
PicTable on sheet 2 to expand the name range but I haven't been successful in
loading the pictures.

"Dave Peterson" wrote:

Maybe you could do something like JE McGimpsey does at:
http://www.mcgimpsey.com/excel/lookuppics.html

PACF wrote:

Can I include a picture in a formula i.e. if cell a26 90% then show picture
x, if less then show picture y?...


--

Dave Peterson


--

Dave Peterson

Newbeetle

Can I include a picture in a formula i.e. if cell a26 90% the
 
Hi I love this, would there be a way of altering the code so that it does not
effect one chosen picture, the reason for this is I always want one picture
to be visible at all times as its a logo.

"Dave Peterson" wrote:

Maybe you could do something like JE McGimpsey does at:
http://www.mcgimpsey.com/excel/lookuppics.html

PACF wrote:

Can I include a picture in a formula i.e. if cell a26 90% then show picture
x, if less then show picture y?...


--

Dave Peterson


Dave Peterson

Can I include a picture in a formula i.e. if cell a26 90% the
 
Maybe you can just check the name and then do nothing for that name:

Option Explicit

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("F1")
For Each oPic In Me.Pictures
If oPic.Name = "Nameofpicturethatshouldnotchange" Then
'do nothing
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


Newbeetle wrote:

Hi I love this, would there be a way of altering the code so that it does not
effect one chosen picture, the reason for this is I always want one picture
to be visible at all times as its a logo.

"Dave Peterson" wrote:

Maybe you could do something like JE McGimpsey does at:
http://www.mcgimpsey.com/excel/lookuppics.html

PACF wrote:

Can I include a picture in a formula i.e. if cell a26 90% then show picture
x, if less then show picture y?...


--

Dave Peterson


--

Dave Peterson

Newbeetle

Can I include a picture in a formula i.e. if cell a26 90% the
 
Hi Dave,

I tried the following as below, but its ends up with a compile error.
Thanks for trying.

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("E30")
For Each oPic In Me.Pictures
If oPic.Name = "Picture 1" Then
'do nothing
Else
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Exit For
End If
Next oPic
End With
End Sub

"Dave Peterson" wrote:

Maybe you can just check the name and then do nothing for that name:

Option Explicit

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("F1")
For Each oPic In Me.Pictures
If oPic.Name = "Nameofpicturethatshouldnotchange" Then
'do nothing
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


Newbeetle wrote:

Hi I love this, would there be a way of altering the code so that it does not
effect one chosen picture, the reason for this is I always want one picture
to be visible at all times as its a logo.

"Dave Peterson" wrote:

Maybe you could do something like JE McGimpsey does at:
http://www.mcgimpsey.com/excel/lookuppics.html

PACF wrote:

Can I include a picture in a formula i.e. if cell a26 90% then show picture
x, if less then show picture y?...

--

Dave Peterson


--

Dave Peterson


Dave Peterson

Can I include a picture in a formula i.e. if cell a26 90% the
 
You dropped an "End If" line near the bottom.

I'm not sure if your code is indented (or if just the message was not), but
indenting can make finding errors like this easier to find. And it would help
others if you indicated the line that was marked as an error and what that error
is, too.

Option Explicit
Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("E30")
For Each oPic In Me.Pictures
If oPic.Name = "Picture 1" Then
'do nothing
Else
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Exit For
End If
End If '<--- Added
Next oPic
End With
End Sub




Newbeetle wrote:

Hi Dave,

I tried the following as below, but its ends up with a compile error.
Thanks for trying.

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("E30")
For Each oPic In Me.Pictures
If oPic.Name = "Picture 1" Then
'do nothing
Else
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Exit For
End If
Next oPic
End With
End Sub

"Dave Peterson" wrote:

Maybe you can just check the name and then do nothing for that name:

Option Explicit

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("F1")
For Each oPic In Me.Pictures
If oPic.Name = "Nameofpicturethatshouldnotchange" Then
'do nothing
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


Newbeetle wrote:

Hi I love this, would there be a way of altering the code so that it does not
effect one chosen picture, the reason for this is I always want one picture
to be visible at all times as its a logo.

"Dave Peterson" wrote:

Maybe you could do something like JE McGimpsey does at:
http://www.mcgimpsey.com/excel/lookuppics.html

PACF wrote:

Can I include a picture in a formula i.e. if cell a26 90% then show picture
x, if less then show picture y?...

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson

Newbeetle

Can I include a picture in a formula i.e. if cell a26 90% the
 
Hi Dave,

Thank you, sorry about that, I don't dive into the VB editor very often so
it doesn't stick in the grey cells.

Thanks again for your help and quick response.

"Dave Peterson" wrote:

You dropped an "End If" line near the bottom.

I'm not sure if your code is indented (or if just the message was not), but
indenting can make finding errors like this easier to find. And it would help
others if you indicated the line that was marked as an error and what that error
is, too.

Option Explicit
Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("E30")
For Each oPic In Me.Pictures
If oPic.Name = "Picture 1" Then
'do nothing
Else
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Exit For
End If
End If '<--- Added
Next oPic
End With
End Sub




Newbeetle wrote:

Hi Dave,

I tried the following as below, but its ends up with a compile error.
Thanks for trying.

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("E30")
For Each oPic In Me.Pictures
If oPic.Name = "Picture 1" Then
'do nothing
Else
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Exit For
End If
Next oPic
End With
End Sub

"Dave Peterson" wrote:

Maybe you can just check the name and then do nothing for that name:

Option Explicit

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("F1")
For Each oPic In Me.Pictures
If oPic.Name = "Nameofpicturethatshouldnotchange" Then
'do nothing
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


Newbeetle wrote:

Hi I love this, would there be a way of altering the code so that it does not
effect one chosen picture, the reason for this is I always want one picture
to be visible at all times as its a logo.

"Dave Peterson" wrote:

Maybe you could do something like JE McGimpsey does at:
http://www.mcgimpsey.com/excel/lookuppics.html

PACF wrote:

Can I include a picture in a formula i.e. if cell a26 90% then show picture
x, if less then show picture y?...

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


Dave Peterson

Can I include a picture in a formula i.e. if cell a26 90% the
 
You can change the fill color for those grey cells.

Select that range
format|cells|Pattern tab|Choose no color

<vvbg



Newbeetle wrote:

Hi Dave,

Thank you, sorry about that, I don't dive into the VB editor very often so
it doesn't stick in the grey cells.

Thanks again for your help and quick response.

"Dave Peterson" wrote:

You dropped an "End If" line near the bottom.

I'm not sure if your code is indented (or if just the message was not), but
indenting can make finding errors like this easier to find. And it would help
others if you indicated the line that was marked as an error and what that error
is, too.

Option Explicit
Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("E30")
For Each oPic In Me.Pictures
If oPic.Name = "Picture 1" Then
'do nothing
Else
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Exit For
End If
End If '<--- Added
Next oPic
End With
End Sub




Newbeetle wrote:

Hi Dave,

I tried the following as below, but its ends up with a compile error.
Thanks for trying.

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("E30")
For Each oPic In Me.Pictures
If oPic.Name = "Picture 1" Then
'do nothing
Else
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Exit For
End If
Next oPic
End With
End Sub

"Dave Peterson" wrote:

Maybe you can just check the name and then do nothing for that name:

Option Explicit

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("F1")
For Each oPic In Me.Pictures
If oPic.Name = "Nameofpicturethatshouldnotchange" Then
'do nothing
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


Newbeetle wrote:

Hi I love this, would there be a way of altering the code so that it does not
effect one chosen picture, the reason for this is I always want one picture
to be visible at all times as its a logo.

"Dave Peterson" wrote:

Maybe you could do something like JE McGimpsey does at:
http://www.mcgimpsey.com/excel/lookuppics.html

PACF wrote:

Can I include a picture in a formula i.e. if cell a26 90% then show picture
x, if less then show picture y?...

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson

chrstrcy

Can I include a picture in a formula i.e. if cell a26 90% the
 


"Dave Peterson" wrote:

Maybe you can just check the name and then do nothing for that name:

Option Explicit

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("F1")
For Each oPic In Me.Pictures
If oPic.Name = "Nameofpicturethatshouldnotchange" Then
'do nothing
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


Newbeetle wrote:

Hi I love this, would there be a way of altering the code so that it does not
effect one chosen picture, the reason for this is I always want one picture
to be visible at all times as its a logo.

"Dave Peterson" wrote:

Maybe you could do something like JE McGimpsey does at:
http://www.mcgimpsey.com/excel/lookuppics.html

PACF wrote:

Can I include a picture in a formula i.e. if cell a26 90% then show picture
x, if less then show picture y?...

--

Dave Peterson


--

Dave Peterson


chrstrcy

Can I include a picture in a formula i.e. if cell a26 90% the
 
I am trying to do the same thing as the other gentleman but apparently I am
missing something. I have entered what you have below but my logo "Picture
1" keeps disappearing everytime I use the other event (I have it inserting a
signature upon a person's name).

***Please help!


"Dave Peterson" wrote:

Maybe you can just check the name and then do nothing for that name:

Option Explicit

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("F1")
For Each oPic In Me.Pictures
If oPic.Name = "Nameofpicturethatshouldnotchange" Then
'do nothing
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


Newbeetle wrote:

Hi I love this, would there be a way of altering the code so that it does not
effect one chosen picture, the reason for this is I always want one picture
to be visible at all times as its a logo.

"Dave Peterson" wrote:

Maybe you could do something like JE McGimpsey does at:
http://www.mcgimpsey.com/excel/lookuppics.html

PACF wrote:

Can I include a picture in a formula i.e. if cell a26 90% then show picture
x, if less then show picture y?...

--

Dave Peterson


--

Dave Peterson


Dave Peterson

Can I include a picture in a formula i.e. if cell a26 90% the
 
Did you change the name of the picture in the code?

chrstrcy wrote:

I am trying to do the same thing as the other gentleman but apparently I am
missing something. I have entered what you have below but my logo "Picture
1" keeps disappearing everytime I use the other event (I have it inserting a
signature upon a person's name).

***Please help!

"Dave Peterson" wrote:

Maybe you can just check the name and then do nothing for that name:

Option Explicit

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("F1")
For Each oPic In Me.Pictures
If oPic.Name = "Nameofpicturethatshouldnotchange" Then
'do nothing
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


Newbeetle wrote:

Hi I love this, would there be a way of altering the code so that it does not
effect one chosen picture, the reason for this is I always want one picture
to be visible at all times as its a logo.

"Dave Peterson" wrote:

Maybe you could do something like JE McGimpsey does at:
http://www.mcgimpsey.com/excel/lookuppics.html

PACF wrote:

Can I include a picture in a formula i.e. if cell a26 90% then show picture
x, if less then show picture y?...

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson

chrstrcy

Can I include a picture in a formula i.e. if cell a26 90% the
 
Yes, I changed the code to read "Picture 1" and then I inserted the picture
where I needed it in the file and named it Picture 1. But then when I test
by changed the signature event it deletes the picture 1.

"Dave Peterson" wrote:

Did you change the name of the picture in the code?

chrstrcy wrote:

I am trying to do the same thing as the other gentleman but apparently I am
missing something. I have entered what you have below but my logo "Picture
1" keeps disappearing everytime I use the other event (I have it inserting a
signature upon a person's name).

***Please help!

"Dave Peterson" wrote:

Maybe you can just check the name and then do nothing for that name:

Option Explicit

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("F1")
For Each oPic In Me.Pictures
If oPic.Name = "Nameofpicturethatshouldnotchange" Then
'do nothing
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


Newbeetle wrote:

Hi I love this, would there be a way of altering the code so that it does not
effect one chosen picture, the reason for this is I always want one picture
to be visible at all times as its a logo.

"Dave Peterson" wrote:

Maybe you could do something like JE McGimpsey does at:
http://www.mcgimpsey.com/excel/lookuppics.html

PACF wrote:

Can I include a picture in a formula i.e. if cell a26 90% then show picture
x, if less then show picture y?...

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


chrstrcy

Can I include a picture in a formula i.e. if cell a26 90% the
 
Here is my code:


Option Explicit

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("A66")
For Each oPic In Me.Pictures
If oPic.Name = "Picture 1" Then
'do nothing
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


"chrstrcy" wrote:

Yes, I changed the code to read "Picture 1" and then I inserted the picture
where I needed it in the file and named it Picture 1. But then when I test
by changed the signature event it deletes the picture 1.

"Dave Peterson" wrote:

Did you change the name of the picture in the code?

chrstrcy wrote:

I am trying to do the same thing as the other gentleman but apparently I am
missing something. I have entered what you have below but my logo "Picture
1" keeps disappearing everytime I use the other event (I have it inserting a
signature upon a person's name).

***Please help!

"Dave Peterson" wrote:

Maybe you can just check the name and then do nothing for that name:

Option Explicit

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("F1")
For Each oPic In Me.Pictures
If oPic.Name = "Nameofpicturethatshouldnotchange" Then
'do nothing
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


Newbeetle wrote:

Hi I love this, would there be a way of altering the code so that it does not
effect one chosen picture, the reason for this is I always want one picture
to be visible at all times as its a logo.

"Dave Peterson" wrote:

Maybe you could do something like JE McGimpsey does at:
http://www.mcgimpsey.com/excel/lookuppics.html

PACF wrote:

Can I include a picture in a formula i.e. if cell a26 90% then show picture
x, if less then show picture y?...

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


Dave Peterson

Can I include a picture in a formula i.e. if cell a26 90% the
 
So you want to see "Picture 1" all the time?

Option Explicit
Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False 'this hides all the pictures
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

chrstrcy wrote:

Here is my code:

Option Explicit

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("A66")
For Each oPic In Me.Pictures
If oPic.Name = "Picture 1" Then
'do nothing
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

"chrstrcy" wrote:

Yes, I changed the code to read "Picture 1" and then I inserted the picture
where I needed it in the file and named it Picture 1. But then when I test
by changed the signature event it deletes the picture 1.

"Dave Peterson" wrote:

Did you change the name of the picture in the code?

chrstrcy wrote:

I am trying to do the same thing as the other gentleman but apparently I am
missing something. I have entered what you have below but my logo "Picture
1" keeps disappearing everytime I use the other event (I have it inserting a
signature upon a person's name).

***Please help!

"Dave Peterson" wrote:

Maybe you can just check the name and then do nothing for that name:

Option Explicit

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("F1")
For Each oPic In Me.Pictures
If oPic.Name = "Nameofpicturethatshouldnotchange" Then
'do nothing
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


Newbeetle wrote:

Hi I love this, would there be a way of altering the code so that it does not
effect one chosen picture, the reason for this is I always want one picture
to be visible at all times as its a logo.

"Dave Peterson" wrote:

Maybe you could do something like JE McGimpsey does at:
http://www.mcgimpsey.com/excel/lookuppics.html

PACF wrote:

Can I include a picture in a formula i.e. if cell a26 90% then show picture
x, if less then show picture y?...

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson

chrstrcy

Can I include a picture in a formula i.e. if cell a26 90% the
 
Yes, and I want it to show in cell A1 - does this need to be noted in the
code as well?? I will try what you have below. Thank you for your help.

"Dave Peterson" wrote:

So you want to see "Picture 1" all the time?

Option Explicit
Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False 'this hides all the pictures
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

chrstrcy wrote:

Here is my code:

Option Explicit

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("A66")
For Each oPic In Me.Pictures
If oPic.Name = "Picture 1" Then
'do nothing
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

"chrstrcy" wrote:

Yes, I changed the code to read "Picture 1" and then I inserted the picture
where I needed it in the file and named it Picture 1. But then when I test
by changed the signature event it deletes the picture 1.

"Dave Peterson" wrote:

Did you change the name of the picture in the code?

chrstrcy wrote:

I am trying to do the same thing as the other gentleman but apparently I am
missing something. I have entered what you have below but my logo "Picture
1" keeps disappearing everytime I use the other event (I have it inserting a
signature upon a person's name).

***Please help!

"Dave Peterson" wrote:

Maybe you can just check the name and then do nothing for that name:

Option Explicit

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("F1")
For Each oPic In Me.Pictures
If oPic.Name = "Nameofpicturethatshouldnotchange" Then
'do nothing
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


Newbeetle wrote:

Hi I love this, would there be a way of altering the code so that it does not
effect one chosen picture, the reason for this is I always want one picture
to be visible at all times as its a logo.

"Dave Peterson" wrote:

Maybe you could do something like JE McGimpsey does at:
http://www.mcgimpsey.com/excel/lookuppics.html

PACF wrote:

Can I include a picture in a formula i.e. if cell a26 90% then show picture
x, if less then show picture y?...

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


Dave Peterson

Can I include a picture in a formula i.e. if cell a26 90% the
 
Nope. The code will use the name--not the location.

Did it work when you tried it?

chrstrcy wrote:

Yes, and I want it to show in cell A1 - does this need to be noted in the
code as well?? I will try what you have below. Thank you for your help.

"Dave Peterson" wrote:

So you want to see "Picture 1" all the time?

Option Explicit
Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False 'this hides all the pictures
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

chrstrcy wrote:

Here is my code:

Option Explicit

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("A66")
For Each oPic In Me.Pictures
If oPic.Name = "Picture 1" Then
'do nothing
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

"chrstrcy" wrote:

Yes, I changed the code to read "Picture 1" and then I inserted the picture
where I needed it in the file and named it Picture 1. But then when I test
by changed the signature event it deletes the picture 1.

"Dave Peterson" wrote:

Did you change the name of the picture in the code?

chrstrcy wrote:

I am trying to do the same thing as the other gentleman but apparently I am
missing something. I have entered what you have below but my logo "Picture
1" keeps disappearing everytime I use the other event (I have it inserting a
signature upon a person's name).

***Please help!

"Dave Peterson" wrote:

Maybe you can just check the name and then do nothing for that name:

Option Explicit

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("F1")
For Each oPic In Me.Pictures
If oPic.Name = "Nameofpicturethatshouldnotchange" Then
'do nothing
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


Newbeetle wrote:

Hi I love this, would there be a way of altering the code so that it does not
effect one chosen picture, the reason for this is I always want one picture
to be visible at all times as its a logo.

"Dave Peterson" wrote:

Maybe you could do something like JE McGimpsey does at:
http://www.mcgimpsey.com/excel/lookuppics.html

PACF wrote:

Can I include a picture in a formula i.e. if cell a26 90% then show picture
x, if less then show picture y?...

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson

chrstrcy

Can I include a picture in a formula i.e. if cell a26 90% the
 
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.

"Dave Peterson" wrote:

Nope. The code will use the name--not the location.

Did it work when you tried it?

chrstrcy wrote:

Yes, and I want it to show in cell A1 - does this need to be noted in the
code as well?? I will try what you have below. Thank you for your help.

"Dave Peterson" wrote:

So you want to see "Picture 1" all the time?

Option Explicit
Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False 'this hides all the pictures
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

chrstrcy wrote:

Here is my code:

Option Explicit

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("A66")
For Each oPic In Me.Pictures
If oPic.Name = "Picture 1" Then
'do nothing
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

"chrstrcy" wrote:

Yes, I changed the code to read "Picture 1" and then I inserted the picture
where I needed it in the file and named it Picture 1. But then when I test
by changed the signature event it deletes the picture 1.

"Dave Peterson" wrote:

Did you change the name of the picture in the code?

chrstrcy wrote:

I am trying to do the same thing as the other gentleman but apparently I am
missing something. I have entered what you have below but my logo "Picture
1" keeps disappearing everytime I use the other event (I have it inserting a
signature upon a person's name).

***Please help!

"Dave Peterson" wrote:

Maybe you can just check the name and then do nothing for that name:

Option Explicit

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("F1")
For Each oPic In Me.Pictures
If oPic.Name = "Nameofpicturethatshouldnotchange" Then
'do nothing
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


Newbeetle wrote:

Hi I love this, would there be a way of altering the code so that it does not
effect one chosen picture, the reason for this is I always want one picture
to be visible at all times as its a logo.

"Dave Peterson" wrote:

Maybe you could do something like JE McGimpsey does at:
http://www.mcgimpsey.com/excel/lookuppics.html

PACF wrote:

Can I include a picture in a formula i.e. if cell a26 90% then show picture
x, if less then show picture y?...

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


Dave Peterson

Can I include a picture in a formula i.e. if cell a26 90% the
 
Maybe it's time to describe what you really want and post the current version of
your code.

chrstrcy wrote:

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.

"Dave Peterson" wrote:

Nope. The code will use the name--not the location.

Did it work when you tried it?

chrstrcy wrote:

Yes, and I want it to show in cell A1 - does this need to be noted in the
code as well?? I will try what you have below. Thank you for your help.

"Dave Peterson" wrote:

So you want to see "Picture 1" all the time?

Option Explicit
Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False 'this hides all the pictures
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

chrstrcy wrote:

Here is my code:

Option Explicit

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("A66")
For Each oPic In Me.Pictures
If oPic.Name = "Picture 1" Then
'do nothing
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

"chrstrcy" wrote:

Yes, I changed the code to read "Picture 1" and then I inserted the picture
where I needed it in the file and named it Picture 1. But then when I test
by changed the signature event it deletes the picture 1.

"Dave Peterson" wrote:

Did you change the name of the picture in the code?

chrstrcy wrote:

I am trying to do the same thing as the other gentleman but apparently I am
missing something. I have entered what you have below but my logo "Picture
1" keeps disappearing everytime I use the other event (I have it inserting a
signature upon a person's name).

***Please help!

"Dave Peterson" wrote:

Maybe you can just check the name and then do nothing for that name:

Option Explicit

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("F1")
For Each oPic In Me.Pictures
If oPic.Name = "Nameofpicturethatshouldnotchange" Then
'do nothing
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


Newbeetle wrote:

Hi I love this, would there be a way of altering the code so that it does not
effect one chosen picture, the reason for this is I always want one picture
to be visible at all times as its a logo.

"Dave Peterson" wrote:

Maybe you could do something like JE McGimpsey does at:
http://www.mcgimpsey.com/excel/lookuppics.html

PACF wrote:

Can I include a picture in a formula i.e. if cell a26 90% then show picture
x, if less then show picture y?...

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson

chrstrcy

Can I include a picture in a formula i.e. if cell a26 90% the
 
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




"Dave Peterson" wrote:

Maybe it's time to describe what you really want and post the current version of
your code.

chrstrcy wrote:

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.

"Dave Peterson" wrote:

Nope. The code will use the name--not the location.

Did it work when you tried it?

chrstrcy wrote:

Yes, and I want it to show in cell A1 - does this need to be noted in the
code as well?? I will try what you have below. Thank you for your help.

"Dave Peterson" wrote:

So you want to see "Picture 1" all the time?

Option Explicit
Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False 'this hides all the pictures
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

chrstrcy wrote:

Here is my code:

Option Explicit

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("A66")
For Each oPic In Me.Pictures
If oPic.Name = "Picture 1" Then
'do nothing
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

"chrstrcy" wrote:

Yes, I changed the code to read "Picture 1" and then I inserted the picture
where I needed it in the file and named it Picture 1. But then when I test
by changed the signature event it deletes the picture 1.

"Dave Peterson" wrote:

Did you change the name of the picture in the code?

chrstrcy wrote:

I am trying to do the same thing as the other gentleman but apparently I am
missing something. I have entered what you have below but my logo "Picture
1" keeps disappearing everytime I use the other event (I have it inserting a
signature upon a person's name).

***Please help!

"Dave Peterson" wrote:

Maybe you can just check the name and then do nothing for that name:

Option Explicit

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("F1")
For Each oPic In Me.Pictures
If oPic.Name = "Nameofpicturethatshouldnotchange" Then
'do nothing
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


Newbeetle wrote:

Hi I love this, would there be a way of altering the code so that it does not
effect one chosen picture, the reason for this is I always want one picture
to be visible at all times as its a logo.

"Dave Peterson" wrote:

Maybe you could do something like JE McGimpsey does at:
http://www.mcgimpsey.com/excel/lookuppics.html

PACF wrote:

Can I include a picture in a formula i.e. if cell a26 90% then show picture
x, if less then show picture y?...

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


Dave Peterson

Can I include a picture in a formula i.e. if cell a26 90% the
 
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?


chrstrcy wrote:

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

"Dave Peterson" wrote:

Maybe it's time to describe what you really want and post the current version of
your code.

chrstrcy wrote:

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.

"Dave Peterson" wrote:

Nope. The code will use the name--not the location.

Did it work when you tried it?

chrstrcy wrote:

Yes, and I want it to show in cell A1 - does this need to be noted in the
code as well?? I will try what you have below. Thank you for your help.

"Dave Peterson" wrote:

So you want to see "Picture 1" all the time?

Option Explicit
Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False 'this hides all the pictures
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

chrstrcy wrote:

Here is my code:

Option Explicit

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("A66")
For Each oPic In Me.Pictures
If oPic.Name = "Picture 1" Then
'do nothing
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

"chrstrcy" wrote:

Yes, I changed the code to read "Picture 1" and then I inserted the picture
where I needed it in the file and named it Picture 1. But then when I test
by changed the signature event it deletes the picture 1.

"Dave Peterson" wrote:

Did you change the name of the picture in the code?

chrstrcy wrote:

I am trying to do the same thing as the other gentleman but apparently I am
missing something. I have entered what you have below but my logo "Picture
1" keeps disappearing everytime I use the other event (I have it inserting a
signature upon a person's name).

***Please help!

"Dave Peterson" wrote:

Maybe you can just check the name and then do nothing for that name:

Option Explicit

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("F1")
For Each oPic In Me.Pictures
If oPic.Name = "Nameofpicturethatshouldnotchange" Then
'do nothing
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


Newbeetle wrote:

Hi I love this, would there be a way of altering the code so that it does not
effect one chosen picture, the reason for this is I always want one picture
to be visible at all times as its a logo.

"Dave Peterson" wrote:

Maybe you could do something like JE McGimpsey does at:
http://www.mcgimpsey.com/excel/lookuppics.html

PACF wrote:

Can I include a picture in a formula i.e. if cell a26 90% then show picture
x, if less then show picture y?...

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


All times are GMT +1. The time now is 04:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com