ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hide Sheet If.... (https://www.excelbanter.com/excel-programming/307359-hide-sheet-if.html)

JPAUL

Hide Sheet If....
 
Hi All,

As part of a greater routine, I'd like to Hide a worksheet
if a certain condition exists in a cell located on a
different sheet. For example, If: Sheet1!A1 = TRUE, Hide
Sheet2.

Any help is appreciated.

Tom Ogilvy

Hide Sheet If....
 
Use the calculate event to check the cell or if the cell would be changed
through manual entry, then use the change event.

There is no function you can place in a cell to perform this type of action.

http://www.cpearson.com/excel/events.htm

Chip Pearson's page on events.

--
Regards,
Tom Ogilvy

"JPAUL" wrote in message
...
Hi All,

As part of a greater routine, I'd like to Hide a worksheet
if a certain condition exists in a cell located on a
different sheet. For example, If: Sheet1!A1 = TRUE, Hide
Sheet2.

Any help is appreciated.




GJones

Hide Sheet If....
 
Hi JPaul

You can use the following


Sub HideMySheet

If Sheets("Sheet1").Range("A1") = "good" Then

Sheets("sheet3").Visible = False

Else
Sheets("sheet3").Visible = True

End If

End Sub

Thanks

Greg

-----Original Message-----
Hi All,

As part of a greater routine, I'd like to Hide a

worksheet
if a certain condition exists in a cell located on a
different sheet. For example, If: Sheet1!A1 = TRUE, Hide
Sheet2.

Any help is appreciated.
.


Tom Ogilvy

Hide Sheet If....
 
Missed you part of a greater routine.

if range("Sheet1!A1").Value then worksheets("Sheet2").Visible =
xlSheetHidden


or if A1 of sheet1 will always be true or false

Worksheets("Sheet2").Visible = Not Range("Sheet1!A1")

--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote in message
...
Use the calculate event to check the cell or if the cell would be changed
through manual entry, then use the change event.

There is no function you can place in a cell to perform this type of

action.

http://www.cpearson.com/excel/events.htm

Chip Pearson's page on events.

--
Regards,
Tom Ogilvy

"JPAUL" wrote in message
...
Hi All,

As part of a greater routine, I'd like to Hide a worksheet
if a certain condition exists in a cell located on a
different sheet. For example, If: Sheet1!A1 = TRUE, Hide
Sheet2.

Any help is appreciated.






JP[_12_]

Hide Sheet If....
 
Thanks for your response. Unfortunately, I get a "Type
Mismatch" error for:

If Sheets("ASP").Range("AE46") = "TRUE" Then
Sheets(" Scorecard").Visible = False

Else: Sheets(" Scorecard").Visible = True
End If



-----Original Message-----
Hi JPaul

You can use the following


Sub HideMySheet

If Sheets("Sheet1").Range("A1") = "good" Then

Sheets("sheet3").Visible = False

Else
Sheets("sheet3").Visible = True

End If

End Sub

Thanks

Greg

-----Original Message-----
Hi All,

As part of a greater routine, I'd like to Hide a

worksheet
if a certain condition exists in a cell located on a
different sheet. For example, If: Sheet1!A1 = TRUE,

Hide
Sheet2.

Any help is appreciated.
.

.


Tom Ogilvy

Hide Sheet If....
 
If Sheets("ASP").Range("AE46").Text = "TRUE" Then

or

If Sheets("ASP").Range("AE46")Value = TRUE Then

--
Regards,
Tom Ogilvy


"JP" wrote in message
...
Thanks for your response. Unfortunately, I get a "Type
Mismatch" error for:

If Sheets("ASP").Range("AE46") = "TRUE" Then
Sheets(" Scorecard").Visible = False

Else: Sheets(" Scorecard").Visible = True
End If



-----Original Message-----
Hi JPaul

You can use the following


Sub HideMySheet

If Sheets("Sheet1").Range("A1") = "good" Then

Sheets("sheet3").Visible = False

Else
Sheets("sheet3").Visible = True

End If

End Sub

Thanks

Greg

-----Original Message-----
Hi All,

As part of a greater routine, I'd like to Hide a

worksheet
if a certain condition exists in a cell located on a
different sheet. For example, If: Sheet1!A1 = TRUE,

Hide
Sheet2.

Any help is appreciated.
.

.




JP[_12_]

Hide Sheet If....
 
Success! Thanks.



-----Original Message-----
If Sheets("ASP").Range("AE46").Text = "TRUE" Then

or

If Sheets("ASP").Range("AE46")Value = TRUE Then

--
Regards,
Tom Ogilvy


"JP" wrote in

message
...
Thanks for your response. Unfortunately, I get a "Type
Mismatch" error for:

If Sheets("ASP").Range("AE46") = "TRUE" Then
Sheets(" Scorecard").Visible = False

Else: Sheets(" Scorecard").Visible = True
End If



-----Original Message-----
Hi JPaul

You can use the following


Sub HideMySheet

If Sheets("Sheet1").Range("A1") = "good" Then

Sheets("sheet3").Visible = False

Else
Sheets("sheet3").Visible = True

End If

End Sub

Thanks

Greg

-----Original Message-----
Hi All,

As part of a greater routine, I'd like to Hide a
worksheet
if a certain condition exists in a cell located on a
different sheet. For example, If: Sheet1!A1 = TRUE,

Hide
Sheet2.

Any help is appreciated.
.

.



.



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

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