Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sue Sue is offline
external usenet poster
 
Posts: 285
Default Programmatically hide an object - Excel 2003 or 2007

We have a need to programmatically hide some objects in Excel. We can do it
in PowerPoint because it is easy to define the slide number and object
number. But how to do it in Excel?

My searches through Help only show how to hide a worksheet.

This is what we currently have:
Sub Hide_Objects()
ActiveSheet.Shapes("Object 1").Visible = False
ActiveSheet.Shapes("Object 2").Visible = False
End Sub

Thank you for any help

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Programmatically hide an object - Excel 2003 or 2007

Here are three ways:

Sub HideAndSeek1()
Dim s As Shape
For Each s In ActiveSheet.Shapes
s.Visible = msoFalse
Next
End Sub

Sub HideAndSeek2()
ActiveSheet.Shapes(1).Visible = msoFalse
End Sub

Sub HideAndSeek3()
ActiveSheet.Shapes("Rectangle 1").Visible = msoFalse
End Sub

--
Gary''s Student - gsnu200843


"Sue" wrote:

We have a need to programmatically hide some objects in Excel. We can do it
in PowerPoint because it is easy to define the slide number and object
number. But how to do it in Excel?

My searches through Help only show how to hide a worksheet.

This is what we currently have:
Sub Hide_Objects()
ActiveSheet.Shapes("Object 1").Visible = False
ActiveSheet.Shapes("Object 2").Visible = False
End Sub

Thank you for any help

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
Excel 2003 to 2007 issues - Drawing object groups John Doyle Excel Programming 0 February 10th 09 05:21 PM
Programmatically Protect/Unprotect Ranges in Excel 2003? Tony Excel Programming 2 May 23rd 07 05:27 PM
Removing Add-ins programmatically from Excel 2003 using VBScript Dutch Gemini Excel Programming 3 August 30th 05 03:00 PM
Programmatically set Excel 97 Control Toobar Checkbox object & container name Matt Jensen Excel Programming 19 January 10th 05 07:46 PM
Programmatically inserting a row with Excel 2003 stonequest Excel Programming 4 May 3rd 04 11:58 AM


All times are GMT +1. The time now is 02:07 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"