Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default unhiding / hiding sheets

I have created macros assigned to buttons that open and close individual
sheets. Here is an example -

Sheets("Pay Inflation - Biometrics").Visible = Not Sheets("Pay Inflation -
Biometrics").Visible

I have also created macros that are assigned to buttons that open an close
groups of sheets.
Here is an example -

Application.ScreenUpdating = False
Sheets("Statistics").Visible = Not Sheets("Statistics").Visible
Sheets("Direct Cost Savings Breakdown").Visible = Not Sheets("Direct
Cost Savings Breakdown").Visible
Sheets("Pay Inflation - Biometrics").Visible = Not Sheets("Pay Inflation
- Biometrics").Visible
Sheets("OT Reduction").Visible = Not Sheets("OT Reduction").Visible

The problem I have is that if I have opened a single sheet using the button
for that sheet (in the example at top it is the Pay Inflation - Biometrics
sheet) and I then select the button to open the group of sheets, the Pay
Inflation - Biometrics will close since it was opened by the previous macro..

What error checking or other conditional logic can I add so that if a sheet
is already visible it will not be hidden.. ??
--
Thanks

Larry
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 834
Default unhiding / hiding sheets

Your whole code is a toggle concept, hide it if visible and vice versa. If
you change it to just making it visible if not visible, it will never get
hidden. So I am confused as to your overall objective.

--

HTH

Bob

"Larry Fitch" wrote in message
...
I have created macros assigned to buttons that open and close individual
sheets. Here is an example -

Sheets("Pay Inflation - Biometrics").Visible = Not Sheets("Pay Inflation -
Biometrics").Visible

I have also created macros that are assigned to buttons that open an close
groups of sheets.
Here is an example -

Application.ScreenUpdating = False
Sheets("Statistics").Visible = Not Sheets("Statistics").Visible
Sheets("Direct Cost Savings Breakdown").Visible = Not Sheets("Direct
Cost Savings Breakdown").Visible
Sheets("Pay Inflation - Biometrics").Visible = Not Sheets("Pay
Inflation
- Biometrics").Visible
Sheets("OT Reduction").Visible = Not Sheets("OT Reduction").Visible

The problem I have is that if I have opened a single sheet using the
button
for that sheet (in the example at top it is the Pay Inflation - Biometrics
sheet) and I then select the button to open the group of sheets, the Pay
Inflation - Biometrics will close since it was opened by the previous
macro..

What error checking or other conditional logic can I add so that if a
sheet
is already visible it will not be hidden.. ??
--
Thanks

Larry



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default unhiding / hiding sheets

Hi Bob -

You are correct in regards to the toggle concept..

What I am trying to figure out is how to prevent a sheet that has been
opened individually from being closed when a button assigned to a summary of
sheets that contain the same thing is selected..
--
Thanks

Larry


"Bob Phillips" wrote:

Your whole code is a toggle concept, hide it if visible and vice versa. If
you change it to just making it visible if not visible, it will never get
hidden. So I am confused as to your overall objective.

--

HTH

Bob

"Larry Fitch" wrote in message
...
I have created macros assigned to buttons that open and close individual
sheets. Here is an example -

Sheets("Pay Inflation - Biometrics").Visible = Not Sheets("Pay Inflation -
Biometrics").Visible

I have also created macros that are assigned to buttons that open an close
groups of sheets.
Here is an example -

Application.ScreenUpdating = False
Sheets("Statistics").Visible = Not Sheets("Statistics").Visible
Sheets("Direct Cost Savings Breakdown").Visible = Not Sheets("Direct
Cost Savings Breakdown").Visible
Sheets("Pay Inflation - Biometrics").Visible = Not Sheets("Pay
Inflation
- Biometrics").Visible
Sheets("OT Reduction").Visible = Not Sheets("OT Reduction").Visible

The problem I have is that if I have opened a single sheet using the
button
for that sheet (in the example at top it is the Pay Inflation - Biometrics
sheet) and I then select the button to open the group of sheets, the Pay
Inflation - Biometrics will close since it was opened by the previous
macro..

What error checking or other conditional logic can I add so that if a
sheet
is already visible it will not be hidden.. ??
--
Thanks

Larry



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 834
Default unhiding / hiding sheets

Take that sheet out of the code in the summary sheet.

Or maybe this is what you want

Application.ScreenUpdating = False

With Sheets("Statistics")

.Visible = Not .Visible
End With

With Sheets("Direct Cost Savings Breakdown")

.Visible = Not .Visible
End With

With Sheets("Pay Inflation - Biometrics")

If .Visible < xlSheetVisible Then

.Visible = Not .Visible
End If
End With

With Sheets("OT Reduction")

.Visible = Not .Visible
End With

--

HTH

Bob

"Larry Fitch" wrote in message
...
Hi Bob -

You are correct in regards to the toggle concept..

What I am trying to figure out is how to prevent a sheet that has been
opened individually from being closed when a button assigned to a summary
of
sheets that contain the same thing is selected..
--
Thanks

Larry


"Bob Phillips" wrote:

Your whole code is a toggle concept, hide it if visible and vice versa.
If
you change it to just making it visible if not visible, it will never get
hidden. So I am confused as to your overall objective.

--

HTH

Bob

"Larry Fitch" wrote in message
...
I have created macros assigned to buttons that open and close individual
sheets. Here is an example -

Sheets("Pay Inflation - Biometrics").Visible = Not Sheets("Pay
Inflation -
Biometrics").Visible

I have also created macros that are assigned to buttons that open an
close
groups of sheets.
Here is an example -

Application.ScreenUpdating = False
Sheets("Statistics").Visible = Not Sheets("Statistics").Visible
Sheets("Direct Cost Savings Breakdown").Visible = Not Sheets("Direct
Cost Savings Breakdown").Visible
Sheets("Pay Inflation - Biometrics").Visible = Not Sheets("Pay
Inflation
- Biometrics").Visible
Sheets("OT Reduction").Visible = Not Sheets("OT Reduction").Visible

The problem I have is that if I have opened a single sheet using the
button
for that sheet (in the example at top it is the Pay Inflation -
Biometrics
sheet) and I then select the button to open the group of sheets, the
Pay
Inflation - Biometrics will close since it was opened by the previous
macro..

What error checking or other conditional logic can I add so that if a
sheet
is already visible it will not be hidden.. ??
--
Thanks

Larry



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default unhiding / hiding sheets

Thanks Bob-

This worked...

If I can go back to the well one more time - is there a "global" command
that I can have that will do that contol for all the sheets in the summary
groups ??
--
Thanks

Larry


"Bob Phillips" wrote:

Take that sheet out of the code in the summary sheet.

Or maybe this is what you want

Application.ScreenUpdating = False

With Sheets("Statistics")

.Visible = Not .Visible
End With

With Sheets("Direct Cost Savings Breakdown")

.Visible = Not .Visible
End With

With Sheets("Pay Inflation - Biometrics")

If .Visible < xlSheetVisible Then

.Visible = Not .Visible
End If
End With

With Sheets("OT Reduction")

.Visible = Not .Visible
End With

--

HTH

Bob

"Larry Fitch" wrote in message
...
Hi Bob -

You are correct in regards to the toggle concept..

What I am trying to figure out is how to prevent a sheet that has been
opened individually from being closed when a button assigned to a summary
of
sheets that contain the same thing is selected..
--
Thanks

Larry


"Bob Phillips" wrote:

Your whole code is a toggle concept, hide it if visible and vice versa.
If
you change it to just making it visible if not visible, it will never get
hidden. So I am confused as to your overall objective.

--

HTH

Bob

"Larry Fitch" wrote in message
...
I have created macros assigned to buttons that open and close individual
sheets. Here is an example -

Sheets("Pay Inflation - Biometrics").Visible = Not Sheets("Pay
Inflation -
Biometrics").Visible

I have also created macros that are assigned to buttons that open an
close
groups of sheets.
Here is an example -

Application.ScreenUpdating = False
Sheets("Statistics").Visible = Not Sheets("Statistics").Visible
Sheets("Direct Cost Savings Breakdown").Visible = Not Sheets("Direct
Cost Savings Breakdown").Visible
Sheets("Pay Inflation - Biometrics").Visible = Not Sheets("Pay
Inflation
- Biometrics").Visible
Sheets("OT Reduction").Visible = Not Sheets("OT Reduction").Visible

The problem I have is that if I have opened a single sheet using the
button
for that sheet (in the example at top it is the Pay Inflation -
Biometrics
sheet) and I then select the button to open the group of sheets, the
Pay
Inflation - Biometrics will close since it was opened by the previous
macro..

What error checking or other conditional logic can I add so that if a
sheet
is already visible it will not be hidden.. ??
--
Thanks

Larry


.



.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 834
Default unhiding / hiding sheets

Not sure what you mean there Larry.

--

HTH

Bob

"Larry Fitch" wrote in message
...
Thanks Bob-

This worked...

If I can go back to the well one more time - is there a "global" command
that I can have that will do that contol for all the sheets in the summary
groups ??
--
Thanks

Larry


"Bob Phillips" wrote:

Take that sheet out of the code in the summary sheet.

Or maybe this is what you want

Application.ScreenUpdating = False

With Sheets("Statistics")

.Visible = Not .Visible
End With

With Sheets("Direct Cost Savings Breakdown")

.Visible = Not .Visible
End With

With Sheets("Pay Inflation - Biometrics")

If .Visible < xlSheetVisible Then

.Visible = Not .Visible
End If
End With

With Sheets("OT Reduction")

.Visible = Not .Visible
End With

--

HTH

Bob

"Larry Fitch" wrote in message
...
Hi Bob -

You are correct in regards to the toggle concept..

What I am trying to figure out is how to prevent a sheet that has been
opened individually from being closed when a button assigned to a
summary
of
sheets that contain the same thing is selected..
--
Thanks

Larry


"Bob Phillips" wrote:

Your whole code is a toggle concept, hide it if visible and vice
versa.
If
you change it to just making it visible if not visible, it will never
get
hidden. So I am confused as to your overall objective.

--

HTH

Bob

"Larry Fitch" wrote in message
...
I have created macros assigned to buttons that open and close
individual
sheets. Here is an example -

Sheets("Pay Inflation - Biometrics").Visible = Not Sheets("Pay
Inflation -
Biometrics").Visible

I have also created macros that are assigned to buttons that open an
close
groups of sheets.
Here is an example -

Application.ScreenUpdating = False
Sheets("Statistics").Visible = Not Sheets("Statistics").Visible
Sheets("Direct Cost Savings Breakdown").Visible = Not
Sheets("Direct
Cost Savings Breakdown").Visible
Sheets("Pay Inflation - Biometrics").Visible = Not Sheets("Pay
Inflation
- Biometrics").Visible
Sheets("OT Reduction").Visible = Not Sheets("OT
Reduction").Visible

The problem I have is that if I have opened a single sheet using the
button
for that sheet (in the example at top it is the Pay Inflation -
Biometrics
sheet) and I then select the button to open the group of sheets, the
Pay
Inflation - Biometrics will close since it was opened by the
previous
macro..

What error checking or other conditional logic can I add so that if
a
sheet
is already visible it will not be hidden.. ??
--
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
Hiding / Unhiding Sheets Larry Fitch Excel Discussion (Misc queries) 1 December 2nd 09 02:42 PM
Hiding and Unhiding Sheets Rob Excel Programming 2 January 13th 06 02:32 PM
Hiding and unhiding sheets D.Hay Excel Discussion (Misc queries) 2 December 10th 05 03:59 PM
Hiding/Unhiding multiple sheets in VBA? Simon Lloyd[_660_] Excel Programming 2 November 14th 05 10:57 AM
Hiding and Unhiding work sheets Frank[_19_] Excel Programming 3 November 19th 03 11:27 PM


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