ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Declear which picture I want to show and not?! (https://www.excelbanter.com/excel-programming/370083-declear-picture-i-want-show-not.html)

petterss[_3_]

Declear which picture I want to show and not?!
 

Hi!
Here is same code I have wrote:

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("B41")
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

Now all the pictures in the document get invisible!
I want to declear which picture that should be visible or not. Ex. I
want to make picture 1-11 visible = False. How?
How do I decler that a specific picture should be visible, "Picture
101.Visible = True"?

Thanks?


--
petterss
------------------------------------------------------------------------
petterss's Profile: http://www.excelforum.com/member.php...o&userid=36354
View this thread: http://www.excelforum.com/showthread...hreadid=570683


NickHK

Declear which picture I want to show and not?!
 
From your code, you are hiding all pictures. Then making the one that
matches the text visible and moving it over cell B41.
So if you want more pictures visible, you need to test for in your For/Next
loop and set them to .visible=true

Where is you list of pictures to make visible ?

NickHK

"petterss" wrote in
message ...

Hi!
Here is same code I have wrote:

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("B41")
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

Now all the pictures in the document get invisible!
I want to declear which picture that should be visible or not. Ex. I
want to make picture 1-11 visible = False. How?
How do I decler that a specific picture should be visible, "Picture
101.Visible = True"?

Thanks?


--
petterss
------------------------------------------------------------------------
petterss's Profile:

http://www.excelforum.com/member.php...o&userid=36354
View this thread: http://www.excelforum.com/showthread...hreadid=570683




petterss[_4_]

Declear which picture I want to show and not?!
 

Hi!
The picture I want to be visible are placed in different places in the
document. And in a specific cell I want to show a picture from a list
depending of a choice in an other cell and the other pictures in this
list should be hide.
Can I declear a specific picture to visible? I´m a amateur in VB :) and
would be happy with some excempel!

THanks!

NickHK Wrote:
From your code, you are hiding all pictures. Then making the one that
matches the text visible and moving it over cell B41.
So if you want more pictures visible, you need to test for in your
For/Next
loop and set them to .visible=true

Where is you list of pictures to make visible ?

NickHK

"petterss"
wrote in
message ...

Hi!
Here is same code I have wrote:

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("B41")
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

Now all the pictures in the document get invisible!
I want to declear which picture that should be visible or not. Ex. I
want to make picture 1-11 visible = False. How?
How do I decler that a specific picture should be visible, "Picture
101.Visible = True"?

Thanks?


--
petterss

------------------------------------------------------------------------
petterss's Profile:

http://www.excelforum.com/member.php...o&userid=36354
View this thread:

http://www.excelforum.com/showthread...hreadid=570683



--
petterss
------------------------------------------------------------------------
petterss's Profile: http://www.excelforum.com/member.php...o&userid=36354
View this thread: http://www.excelforum.com/showthread...hreadid=570683


NickHK

Declear which picture I want to show and not?!
 
That's what you are doing here.
You are making visible the picture whose .Name matches the .Text in B41.

From your description, I don't see why your code does not do what you need;
hide all except the one with that name.

NickHK

"petterss" wrote in
message ...

Hi!
The picture I want to be visible are placed in different places in the
document. And in a specific cell I want to show a picture from a list
depending of a choice in an other cell and the other pictures in this
list should be hide.
Can I declear a specific picture to visible? I´m a amateur in VB :) and
would be happy with some excempel!

THanks!

NickHK Wrote:
From your code, you are hiding all pictures. Then making the one that
matches the text visible and moving it over cell B41.
So if you want more pictures visible, you need to test for in your
For/Next
loop and set them to .visible=true

Where is you list of pictures to make visible ?

NickHK

"petterss"
wrote in
message ...

Hi!
Here is same code I have wrote:

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("B41")
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

Now all the pictures in the document get invisible!
I want to declear which picture that should be visible or not. Ex. I
want to make picture 1-11 visible = False. How?
How do I decler that a specific picture should be visible, "Picture
101.Visible = True"?

Thanks?


--
petterss

------------------------------------------------------------------------
petterss's Profile:

http://www.excelforum.com/member.php...o&userid=36354
View this thread:

http://www.excelforum.com/showthread...hreadid=570683



--
petterss
------------------------------------------------------------------------
petterss's Profile:

http://www.excelforum.com/member.php...o&userid=36354
View this thread: http://www.excelforum.com/showthread...hreadid=570683




petterss[_5_]

Declear which picture I want to show and not?!
 

It does, the problem is that it hiding other pictures to(ex one logo
one picture in the Heading). Pictures that dont have anything to d
with the list!
Thats why I want to declear picture 102,103 and 104 to visible!
Is it possible?


NickHK Wrote:
That's what you are doing here.
You are making visible the picture whose .Name matches the .Text i
B41.

From your description, I don't see why your code does not do what yo
need;
hide all except the one with that name.

NickHK

"petterss"
wrote in
message ...

Hi!
The picture I want to be visible are placed in different places i

the
document. And in a specific cell I want to show a picture from

list
depending of a choice in an other cell and the other pictures i

this
list should be hide.
Can I declear a specific picture to visible? I´m a amateur in VB :

and
would be happy with some excempel!

THanks!

NickHK Wrote:
From your code, you are hiding all pictures. Then making the on

that
matches the text visible and moving it over cell B41.
So if you want more pictures visible, you need to test for in your
For/Next
loop and set them to .visible=true

Where is you list of pictures to make visible ?

NickHK

"petterss"
wrote in
messag

...

Hi!
Here is same code I have wrote:

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("B41")
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

Now all the pictures in the document get invisible!
I want to declear which picture that should be visible or not

Ex. I
want to make picture 1-11 visible = False. How?
How do I decler that a specific picture should be visible

"Picture
101.Visible = True"?

Thanks?


--
petterss


------------------------------------------------------------------------
petterss's Profile:
http://www.excelforum.com/member.php...o&userid=36354
View this thread:
http://www.excelforum.com/showthread...hreadid=570683



--
petterss


------------------------------------------------------------------------
petterss's Profile:

http://www.excelforum.com/member.php...o&userid=36354
View this thread

http://www.excelforum.com/showthread...hreadid=570683


--
petters
-----------------------------------------------------------------------
petterss's Profile: http://www.excelforum.com/member.php...fo&userid=3635
View this thread: http://www.excelforum.com/showthread.php?threadid=57068


Ken Johnson

Declear which picture I want to show and not?!
 
Hi,

If you are wanting Picture 102, Picture 103 and Picture 104 to remain
visible at all times then try...

Private Sub Worksheet_Calculate()
Dim oPic As Picture
For Each oPic In Me.Pictures
Select Case oPic.Name
Case "Picture 102", "Picture 103", "Picture 104"
Case Else
oPic.Visible = False
End Select
Next oPic
With Range("B41")
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

Ken Johnson



All times are GMT +1. The time now is 07:03 AM.

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