ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   If a certain cell has a certain value, a certain worksheet is hidden or visible (https://www.excelbanter.com/excel-programming/382888-if-certain-cell-has-certain-value-certain-worksheet-hidden-visible.html)

Matt[_40_]

If a certain cell has a certain value, a certain worksheet is hidden or visible
 
Hello Everyone:

I have a cell named "Input_StepRatePerformed". It has a drop down
list (I am using Data/Validation from the Toolbar) with Yes and No as
the only two choices. What I want to do is if Yes is in the cell, the
worksheet named "SRT" is visible. If No is selected then "SRT"
worksheet is hidden. I have tried some different code such as
worksheet change with no success. I am not sure where to begin. Any
help is greatly appreciated. Thanks in advance.

Matt


Martin Fishlock

If a certain cell has a certain value, a certain worksheet is hidd
 
Hi Matt:

Try a worksheet cahnge event testing for the cell and then testing the value:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not (Intersect(Target, Range("E1")) Is Nothing) Then
Sheets("SRT").Visible = (Me.Range("E1").Value = "Yes")
End If
End Sub
--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Matt" wrote:

Hello Everyone:

I have a cell named "Input_StepRatePerformed". It has a drop down
list (I am using Data/Validation from the Toolbar) with Yes and No as
the only two choices. What I want to do is if Yes is in the cell, the
worksheet named "SRT" is visible. If No is selected then "SRT"
worksheet is hidden. I have tried some different code such as
worksheet change with no success. I am not sure where to begin. Any
help is greatly appreciated. Thanks in advance.

Matt



Matt[_40_]

If a certain cell has a certain value, a certain worksheet is hidd
 
On Feb 9, 12:40 am, Martin Fishlock
wrote:
Hi Matt:

Try a worksheet cahnge event testing for the cell and then testing the value:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not (Intersect(Target, Range("E1")) Is Nothing) Then
Sheets("SRT").Visible = (Me.Range("E1").Value = "Yes")
End If
End Sub
--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.



"Matt" wrote:
Hello Everyone:


I have a cell named "Input_StepRatePerformed". It has a drop down
list (I am using Data/Validation from the Toolbar) with Yes and No as
the only two choices. What I want to do is if Yes is in the cell, the
worksheet named "SRT" is visible. If No is selected then "SRT"
worksheet is hidden. I have tried some different code such as
worksheet change with no success. I am not sure where to begin. Any
help is greatly appreciated. Thanks in advance.


Matt- Hide quoted text -


- Show quoted text -


How do I make it invisible if No is selected? I am a newbie trying to
learn. Thanks.


Matt[_40_]

If a certain cell has a certain value, a certain worksheet is hidd
 
I put it in and it works. Martin, I appreciate the help. I have been
pulling my hair out. Thanks again. I'll rate your post as excellent.

Matt



All times are GMT +1. The time now is 01:07 PM.

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