ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Hide Selected Objects (https://www.excelbanter.com/excel-worksheet-functions/235205-hide-selected-objects.html)

clara

Hide Selected Objects
 
Hi,

Anyone know how can i hide selected objects only instead of hiding all
objects in my worksheet?

Shane Devenshire[_2_]

Hide Selected Objects
 
Hi,

If you are refering to the command Tools, Options, View, Objects Hide All,
then the answer there is no such feature built into Excel.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Clara" wrote:

Hi,

Anyone know how can i hide selected objects only instead of hiding all
objects in my worksheet?


Gord Dibben

Hide Selected Objects
 
With VBA you could probably do this.

What type of objects are you referring to?

Selectable objects you have inserted like drawing objects or pictures?


Gord Dibben MS Excel MVP


On Sat, 27 Jun 2009 07:09:01 -0700, Clara
wrote:

Hi,

Anyone know how can i hide selected objects only instead of hiding all
objects in my worksheet?



Shane Devenshire[_2_]

Hide Selected Objects
 
Hi,

Following up on Gord's suggestion here is code that will hide the selected
objects, in this case shapes:

Selection.ShapeRange.Visible = False

Keep in mind that you can't reverse this by writing

Selection.ShapeRange.Visible = True

besause you can't select things you can't see. So in that case you need
something like this

ActiveSheet.Shapes.Range(Array("Rectangle 1", "Rectangle 2")).Visible = True

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Gord Dibben" wrote:

With VBA you could probably do this.

What type of objects are you referring to?

Selectable objects you have inserted like drawing objects or pictures?


Gord Dibben MS Excel MVP


On Sat, 27 Jun 2009 07:09:01 -0700, Clara
wrote:

Hi,

Anyone know how can i hide selected objects only instead of hiding all
objects in my worksheet?




Jacob Skaria

Hide Selected Objects
 
Hi Clara

Try the below macro. You dont need to select the object; instead just select
the cell range. All objects within selection will be hidden

Sub Macro1()
Dim obj As Object
For Each obj In ActiveSheet.DrawingObjects
If Not Intersect(obj.TopLeftCell, Selection) Is Nothing Then
obj.Visible = False
End If
Next
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Clara" wrote:

Hi,

Anyone know how can i hide selected objects only instead of hiding all
objects in my worksheet?



All times are GMT +1. The time now is 01:55 PM.

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