Hide yesterday sheet.

  • Thread starter Thread starter Anirudh
  • Start date Start date
You have to tell me how your worksheets are named to give a complete
solution. Here is some code that need to be modified based on the way you
name the worksheets

For Each sht In ThisWorkbook.Sheets
If sht.Name <> "Yesterday" And _
sht.Name <> "Today" Then

sht.Rows("1:" & Rows.Count).Hidden = True
sht.Protect _
Password:="ABC", _
DrawingObjects:=True, _
Contents:=True, _
Scenarios:=True
End If
Next sht
 
Back
Top