I am new to VBA at the age of 62 and I am trying to teach myself VBA. I have a project that I am working on. The file has a single "interface" worksheet and the other 40 worksheets will have either a "Yes" or a "No" in cell A2. If A2 = "No" I want to hide the worksheet. I currently have code that loops through each worksheet to change the worksheet name based on the value in A1.
What do I need to add?
VBA Code:
Sub RenameSheets()
For i = 1 To Sheets.Count
Sheets(i).Activate
ActiveSheet.Name = ActiveSheet.Range("a1").Value
Next i
Sheets(2).Activate
End Sub
What do I need to add?