Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default Macro "on off" switch


I have a very simple macro assigned to a button that unhides a sheet

Sub HR_Training()
'
' HR_Training Macro
' Unhide only the HR Training Hard Dollar Cost Savings Sheet
'

'
Application.ScreenUpdating = False
Sheets("HR - Training").Visible = True
Sheets("Selection Sheet").Select
End Sub
--

What I would like to do is add a "toggle" type of functionality so that the
first press of the button will unhide the sheet, and the next time it will
hide it..

any help would be most appreciated..
Thanks

Larry
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Macro "on off" switch

Try this...

Sub HR_Training()
'
' HR_Training Macro
' Unhide only the HR Training Hard Dollar Cost Savings Sheet
'

Sheets("HR - Training").Visible = not Sheets("HR - Training").Visible
End Sub

--
HTH...

Jim Thomlinson


"Larry Fitch" wrote:


I have a very simple macro assigned to a button that unhides a sheet

Sub HR_Training()
'
' HR_Training Macro
' Unhide only the HR Training Hard Dollar Cost Savings Sheet
'

'
Application.ScreenUpdating = False
Sheets("HR - Training").Visible = True
Sheets("Selection Sheet").Select
End Sub
--

What I would like to do is add a "toggle" type of functionality so that the
first press of the button will unhide the sheet, and the next time it will
hide it..

any help would be most appreciated..
Thanks

Larry

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 793
Default Macro "on off" switch

Use
Sheets("HR - Training").Visible = Not Sheets("HR - Training").Visible

in place of
Sheets("HR - Training").Visible = True

"Larry Fitch" wrote:


I have a very simple macro assigned to a button that unhides a sheet

Sub HR_Training()
'
' HR_Training Macro
' Unhide only the HR Training Hard Dollar Cost Savings Sheet
'

'
Application.ScreenUpdating = False
Sheets("HR - Training").Visible = True
Sheets("Selection Sheet").Select
End Sub
--

What I would like to do is add a "toggle" type of functionality so that the
first press of the button will unhide the sheet, and the next time it will
hide it..

any help would be most appreciated..
Thanks

Larry

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default Macro "on off" switch

Thanky you to the both of you..

works like a champ !!
--
Thanks

Larry


"Sheeloo" wrote:

Use
Sheets("HR - Training").Visible = Not Sheets("HR - Training").Visible

in place of
Sheets("HR - Training").Visible = True

"Larry Fitch" wrote:


I have a very simple macro assigned to a button that unhides a sheet

Sub HR_Training()
'
' HR_Training Macro
' Unhide only the HR Training Hard Dollar Cost Savings Sheet
'

'
Application.ScreenUpdating = False
Sheets("HR - Training").Visible = True
Sheets("Selection Sheet").Select
End Sub
--

What I would like to do is add a "toggle" type of functionality so that the
first press of the button will unhide the sheet, and the next time it will
hide it..

any help would be most appreciated..
Thanks

Larry

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
Shortcut to switch from "fill down" to "copy" with mouse drag RJ Dake Excel Discussion (Misc queries) 3 August 13th 09 05:35 PM
Disabled "Switch Row/Column" when creating chart from a pivot tabl Gunder Charts and Charting in Excel 1 October 8th 08 08:48 AM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Why does excell switch my stock symbol "ACN" to "CAN"? garron Setting up and Configuration of Excel 1 June 21st 07 02:35 AM
Macro to concatenate into "B1" B2 thru B"x" based on new data in "Col A" Dennis Excel Discussion (Misc queries) 0 July 17th 06 02:38 PM


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