Hi everyone - I'm trying to get a macro to hide a sheet in my workbook when a certain condition is met in a certain cell. In this case, when the cell (which I've named term) has the value "No Contract", I would like the sheet to hide itself.
What I have is working, but not immediately upon entering "No Contract". For some reason, I have to enter "No Contract" and then click on the cell again to get it to hide, but I want it to be an immediate response to entering that value. I'm not very experienced in macros so I'm not sure where I'm going wrong.
Here is what I've got - again the cell which I want to trigger this is called Term and the worksheet is called COMPASS:
Any advice would be greatly appreciated!Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Address = Me.Range("Term").Address Then If Target.Value = "No Contract" Then Sheets("COMPASS").Visible = False Else Sheets("COMPASS").Visible = True End If End If End Sub
Thanks
Bookmarks