ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hide worksheet when moving back to another sheet (https://www.excelbanter.com/excel-programming/439051-hide-worksheet-when-moving-back-another-sheet.html)

Johanna Gronlund

Hide worksheet when moving back to another sheet
 
Hello,

I have a sheet called 'calculations' that I want normally to be hidden.
However, there is a button on one of the sheet (called 'inputs') for the
users who are interested in detail to unhide it and see it.

Sub Reveal()
With ThisWorkbook
If Worksheets("Calculations").Visible = False Then
Worksheets("Calculations").Visible = True
Worksheets("Calculations").Activate
End If
End With
End Sub

I have managed to get this working by using this forum.

Now, I would like to have a code that hides the sheet 'calculations' again
when the users return to the 'inputs'. I was going to have a button for the
users to use.

As I am not very good with macros, I'd be grateful if someone could help me.

Thanks very much in advance!

--
Johanna

Jacob Skaria

Hide worksheet when moving back to another sheet
 
Sub Macro2()
Sheets("Inputs").Activate
Sheets("Calculations").Visible = False
End Sub

--
Jacob


"Johanna Gronlund" wrote:

Hello,

I have a sheet called 'calculations' that I want normally to be hidden.
However, there is a button on one of the sheet (called 'inputs') for the
users who are interested in detail to unhide it and see it.

Sub Reveal()
With ThisWorkbook
If Worksheets("Calculations").Visible = False Then
Worksheets("Calculations").Visible = True
Worksheets("Calculations").Activate
End If
End With
End Sub

I have managed to get this working by using this forum.

Now, I would like to have a code that hides the sheet 'calculations' again
when the users return to the 'inputs'. I was going to have a button for the
users to use.

As I am not very good with macros, I'd be grateful if someone could help me.

Thanks very much in advance!

--
Johanna


Don Guillett[_2_]

Hide worksheet when moving back to another sheet
 
Why two buttons when ONE will do.

Sub hideunhideworksheet()
Sheets("Sheet19").Visible = True = Not _
Sheets("Sheet19").Visible = True
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Johanna Gronlund" wrote in
message ...
Hello,

I have a sheet called 'calculations' that I want normally to be hidden.
However, there is a button on one of the sheet (called 'inputs') for the
users who are interested in detail to unhide it and see it.

Sub Reveal()
With ThisWorkbook
If Worksheets("Calculations").Visible = False Then
Worksheets("Calculations").Visible = True
Worksheets("Calculations").Activate
End If
End With
End Sub

I have managed to get this working by using this forum.

Now, I would like to have a code that hides the sheet 'calculations' again
when the users return to the 'inputs'. I was going to have a button for
the
users to use.

As I am not very good with macros, I'd be grateful if someone could help
me.

Thanks very much in advance!

--
Johanna




All times are GMT +1. The time now is 03:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com