Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers,microsoft.public.excel.programming
external usenet poster
 
Posts: 113
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   Report Post  
Posted to microsoft.public.excel.newusers,microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
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   Report Post  
Posted to microsoft.public.excel.newusers,microsoft.public.excel.programming
external usenet poster
 
Posts: 113
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   Report Post  
Posted to microsoft.public.excel.newusers,microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
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.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hiding graphics elements? Blue Max New Users to Excel 3 May 2nd 10 03:33 AM
AddIn: IDTExtensibility::BeginShutdown hiding GUI elements too lat Ralf Steinstraesser Excel Programming 0 July 7th 08 03:57 PM
Graphics Jordan Excel Programming 1 November 27th 06 02:55 PM
Hiding a button when hiding rows fergusor Excel Discussion (Misc queries) 2 August 10th 06 02:31 PM
Hiding Column Also hiding text Cindy Excel Programming 0 April 6th 06 07:18 PM


All times are GMT +1. The time now is 03:12 PM.

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

About Us

"It's about Microsoft Excel"