View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Hide yesterday sheet.

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


"Anirudh" wrote:

If someone help me on

how to Hide and protect the sheets till yesterday.