Pookiemeister
Well-known Member
- Joined
- Jan 6, 2012
- Messages
- 626
- Office Version
- 365
- 2010
- Platform
- Windows
VBA Code:
Sub week_num()
Dim ws As Worksheets, ws1 as Worksheets
Dim wb as Workbook
Set wb = ThisWorkbook
WeekNum = Application.WorksheetFunction.RoundUp(Day(Now()) / 7, 0)
Select Case WeekNum
Case 1
Set ws = wb.Worksheets("WO Week 1")[B] 'First occurrence happens here[/B]
ws.Unprotect
Set ws1 = wb.Worksheets("Past Due Week 1")
ws1.Unprotect
Case 2
Set ws = wb.Worksheets("Past Due Week 2")
ws.Unprotect
Set ws1 = wb.Worksheets("WO Week 2")
ws1.Unprotect
Case 3
Set ws = wb.Worksheets("Past Due Week 3")
ws.Unprotect
Set ws1 = wb.Worksheets("WO Week 3")
ws1.Unprotect
Case 4
Set ws = wb.Worksheets("Past Due Week 4")
ws.Unprotect
Set ws1 = wb.Worksheets("WO Week 4")
ws1.Unprotect
Case 5
Set ws = wb.Worksheets("Past Due Week 5")
ws.Unprotect
Set ws1 = wb.Worksheets("WO Week 5")
ws1.Unprotect
Case Else
ws.Protect
ws1.Protect
End Select
Exit Sub
End Sub