Hide Sheet If....

  • Thread starter Thread starter JPAUL
  • Start date Start date
J

JPAUL

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.
 
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.
 
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
 
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")
 
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
 
If Sheets("ASP").Range("AE46").Text = "TRUE" Then

or

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


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

or

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

--
Regards,
Tom Ogilvy





.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top