Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 132
Default 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.
.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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.





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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.
.

.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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.
.

.



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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.
.

.



.

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
Create Sheet, Hide Sheet Dave Excel Discussion (Misc queries) 2 October 30th 07 03:40 PM
hide sheet Jeff Excel Programming 1 June 9th 04 07:55 PM
hide sheet tab gav meredith Excel Programming 18 April 15th 04 05:00 AM
hide sheet? uncheck sheet tabs? or ??? NetComm888 Excel Programming 1 February 10th 04 04:38 AM
Hide Sheet Bob Phillips[_5_] Excel Programming 2 August 7th 03 01:40 PM


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