Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Declear which picture I want to show and not?! | Excel Discussion (Misc queries) | |||
Declear which picture I want to show and not?! | Excel Worksheet Functions | |||
want to show a picture based on a value | Excel Programming | |||
show and hide a picture | Excel Programming | |||
Show picture | Excel Programming |