![]() |
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 |
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 |
All times are GMT +1. The time now is 07:16 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com