Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Show & Hide Shape in a Sheet

Hi All,

Any assistance would be much appreciated.
I'd like to use a togglebuttom to Show / Hide a Shape in a worksheet (in
this case Rectangle 3).
The hide part is easy with using Visible = False but the show part is
hanging me up.

Something tells me that this is a little more complicated than it sounds
because the shape is held in memory location, which means that if it is
hidden at the time the file is opened it needs to be loaded into memory.

Maybe I'm over complicating things?

TIA

Pete


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default Show & Hide Shape in a Sheet

Pete,

I think you might be. If you use a togglebutton from the Control Toolbox,
double-click it and add this code to it's click event it will toggle. If
it's not visible when you open the workbook, clicking the button will make
it so.

Private Sub ToggleButton1_Click()
Worksheets("Sheet1").Shapes("Rectangle 3").Visible = Not (Shapes("Rectangle
3").Visible)
End Sub

hth,

Doug Glancy

"Pete Csiszar" wrote in message
news:QI%Bd.47642$KO5.25511@clgrps13...
Hi All,

Any assistance would be much appreciated.
I'd like to use a togglebuttom to Show / Hide a Shape in a worksheet (in
this case Rectangle 3).
The hide part is easy with using Visible = False but the show part is
hanging me up.

Something tells me that this is a little more complicated than it sounds
because the shape is held in memory location, which means that if it is
hidden at the time the file is opened it needs to be loaded into memory.

Maybe I'm over complicating things?

TIA

Pete




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Show & Hide Shape in a Sheet

If visible = False hides it, then visible = true should show it.

--
Regards,
Tom Ogilvy

"Pete Csiszar" wrote in message
news:QI%Bd.47642$KO5.25511@clgrps13...
Hi All,

Any assistance would be much appreciated.
I'd like to use a togglebuttom to Show / Hide a Shape in a worksheet (in
this case Rectangle 3).
The hide part is easy with using Visible = False but the show part is
hanging me up.

Something tells me that this is a little more complicated than it sounds
because the shape is held in memory location, which means that if it is
hidden at the time the file is opened it needs to be loaded into memory.

Maybe I'm over complicating things?

TIA

Pete




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Show & Hide Shape in a Sheet

Pete
I think you are overcomplicating things.

Private Sub ToggleButton1_Change()
ActiveSheet.Shapes("Rectangle 3").Visible = Not (ActiveSheet.Shapes("Rectangle
3").Visible)
End Sub

will probably do what you want.

Good luck.

Ken
Norfolk, Va
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
Name of the sheet - hide and show Lars, Denmark Excel Discussion (Misc queries) 5 January 21st 09 10:08 PM
Hide n' show cells in protected sheet Excellgreenhorn Excel Worksheet Functions 1 October 27th 07 12:38 AM
Showing + and - (show and hide) for rows in the sheet Kurt Excel Worksheet Functions 1 November 10th 05 12:53 PM
Why can't I show or hide rows in an outline on a protected sheet? rwlass Excel Discussion (Misc queries) 1 December 9th 04 04:38 PM
Hide/show sheets by first part of sheet name Brentus Excel Programming 2 September 15th 04 06:21 AM


All times are GMT +1. The time now is 06:47 PM.

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

About Us

"It's about Microsoft Excel"