A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Hiding graphics elements?



 
 
Thread Tools Display Modes
  #1  
Old April 29th, 2010, 04:23 PM posted to microsoft.public.excel.newusers,microsoft.public.excel.programming
Blue Max
external usenet poster
 
Posts: 301
Default Hiding graphics elements?

How can we hide pre-selected groups of graphics elements with the touch of a
cell or control?

We have two distinct groups of rectangles with gradient fills. Depending on
the state (true/false) of a control, we want one or the other group of
rectangles to be hidden while the other is displayed. Can anyone give us
some direction on how we might accomplish this? Unlike controls, we don't
see where rectangles have a property for visibility or for hiding the
object.

  #2  
Old April 29th, 2010, 04:56 PM posted to microsoft.public.excel.newusers,microsoft.public.excel.programming
Rick Rothstein[_2_]
external usenet poster
 
Posts: 2,013
Default Hiding graphics elements?

Let's say one of your rectangles is named "Rectangle 1", then you can hide
it like this...

Worksheets("Sheet1").Shapes("Rectangle 1").OLEFormat.Object.Visible = False

Setting the above line to True instead of False will show the rectangle
again. In place of the name "Rectangle 1", you can use its Index number if
you know it...

Worksheets("Sheet1").Shapes(1).OLEFormat.Object.Vi sible = False

--
Rick (MVP - Excel)



"Blue Max" wrote in message
...
How can we hide pre-selected groups of graphics elements with the touch of
a cell or control?

We have two distinct groups of rectangles with gradient fills. Depending
on the state (true/false) of a control, we want one or the other group of
rectangles to be hidden while the other is displayed. Can anyone give us
some direction on how we might accomplish this? Unlike controls, we don't
see where rectangles have a property for visibility or for hiding the
object.


  #3  
Old May 2nd, 2010, 02:33 AM posted to microsoft.public.excel.newusers,microsoft.public.excel.programming
Blue Max
external usenet poster
 
Posts: 301
Default Hiding graphics elements?

Rick,

Thank you for the helpful reply. However, isn't there a way to group these
objects and then select and hide/unhide the entire group at once? I know
that controls can be grouped, but not sure how graphic objects can be named
and then selected as a group so that a common property can be changed for
all objects at the same time?

Thanks,
Richard

"Rick Rothstein" wrote in message
...
Let's say one of your rectangles is named "Rectangle 1", then you can hide
it like this...

Worksheets("Sheet1").Shapes("Rectangle 1").OLEFormat.Object.Visible =
False

Setting the above line to True instead of False will show the rectangle
again. In place of the name "Rectangle 1", you can use its Index number if
you know it...

Worksheets("Sheet1").Shapes(1).OLEFormat.Object.Vi sible = False

--
Rick (MVP - Excel)



"Blue Max" wrote in message
...
How can we hide pre-selected groups of graphics elements with the touch
of a cell or control?

We have two distinct groups of rectangles with gradient fills. Depending
on the state (true/false) of a control, we want one or the other group of
rectangles to be hidden while the other is displayed. Can anyone give us
some direction on how we might accomplish this? Unlike controls, we
don't see where rectangles have a property for visibility or for hiding
the object.


  #4  
Old May 2nd, 2010, 03:33 AM posted to microsoft.public.excel.newusers,microsoft.public.excel.programming
Rick Rothstein[_2_]
external usenet poster
 
Posts: 2,013
Default Hiding graphics elements?

I think you have to loop the Shapes collection and test to see which shapes
are rectangle and then apply the action to them...

Dim R As Shape
For Each R In Worksheets("Sheet2").Shapes
If R.AutoShapeType = msoShapeRectangle Then R.Visible = False
Next

--
Rick (MVP - Excel)



"Blue Max" wrote in message
...
Rick,

Thank you for the helpful reply. However, isn't there a way to group
these objects and then select and hide/unhide the entire group at once? I
know that controls can be grouped, but not sure how graphic objects can be
named and then selected as a group so that a common property can be
changed for all objects at the same time?

Thanks,
Richard

"Rick Rothstein" wrote in message
...
Let's say one of your rectangles is named "Rectangle 1", then you can
hide it like this...

Worksheets("Sheet1").Shapes("Rectangle 1").OLEFormat.Object.Visible =
False

Setting the above line to True instead of False will show the rectangle
again. In place of the name "Rectangle 1", you can use its Index number
if you know it...

Worksheets("Sheet1").Shapes(1).OLEFormat.Object.Vi sible = False

--
Rick (MVP - Excel)



"Blue Max" wrote in message
...
How can we hide pre-selected groups of graphics elements with the touch
of a cell or control?

We have two distinct groups of rectangles with gradient fills.
Depending on the state (true/false) of a control, we want one or the
other group of rectangles to be hidden while the other is displayed.
Can anyone give us some direction on how we might accomplish this?
Unlike controls, we don't see where rectangles have a property for
visibility or for hiding the object.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:21 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.