So a have code written in tab 'sheet1'. And Basically if the tab becomes hidden, I want the word 'No' written in the tab 'info'. And when the tab becomes unhidden, I want the word 'Yes' written in the tab 'info'. At the moment, when i unhide/hide 'sheet1' nothing happens.
Code:
Private Sub Worksheet_Change()
If ActiveSheet.Visible = True Then
Sheets("Info").Visible = True
ActiveSheet.Range("D2").Select
ActiveCell.FormulaR1C1 = "Yes"
Sheets("Info").Visible = False
ElseIf ActiveSheet.Visible = False Then
Sheets("Info").Visible = True
ActiveSheet.Range("D2").Select
ActiveCell.FormulaR1C1 = "No"
Sheets("Info").Visible = False
End If
End Sub