Select Case wsNew.Name
Case "January", "March", "May", "July", "August", "October", "December"
wsNew.Range("D2:E2").Autofill Destination:=wsNew.Range("D2:AH2"), Type:=xlFillSeries
With wsNew.Range("D1", "AH1")
.Font.Bold = True
.Font.Size = 12
.VerticalAlignment = xlVAlignCenter
.HorizontalAlignment = xlVAlignCenter
.MergeCells = True
If wsNew.Name = "January" Then
.Value = "January"
wsNew.cells(3, 4).Value = "Saturday"
wsNew.Range("D3").Autofill Destination:=wsNew.Range("D3:AH3"), Type:=xlFillWeekdays
With wsNew.Range("D3", "AH3")
.HorizontalAlignment = xlVAlignCenter
End With
ElseIf wsNew.Name = "March" Then
.Value = "March"
wsNew.cells(3, 4).Value = "Tuesday"
wsNew.Range("D3").Autofill Destination:=wsNew.Range("D3:AH3"), Type:=xlFillWeekdays
With wsNew.Range("D3", "AH3")
.HorizontalAlignment = xlVAlignCenter
End With
ElseIf wsNew.Name = "May" Then
.Value = "May"
wsNew.cells(3, 4).Value = "Sunday"
wsNew.Range("D3").Autofill Destination:=wsNew.Range("D3:AH3"), Type:=xlFillWeekdays
With wsNew.Range("D3", "AH3")
.HorizontalAlignment = xlVAlignCenter
End With
ElseIf wsNew.Name = "July" Then
.Value = "July"
wsNew.cells(3, 4).Value = "Friday"
wsNew.Range("D3").Autofill Destination:=wsNew.Range("D3:AH3"), Type:=xlFillWeekdays
With wsNew.Range("D3", "AH3")
.HorizontalAlignment = xlVAlignCenter
End With
ElseIf wsNew.Name = "August" Then
.Value = "August"
wsNew.cells(3, 4).Value = "Monday"
wsNew.Range("D3").Autofill Destination:=wsNew.Range("D3:AH3"), Type:=xlFillWeekdays
With wsNew.Range("D3", "AH3")
.HorizontalAlignment = xlVAlignCenter
End With
ElseIf wsNew.Name = "October" Then
.Value = "October"
wsNew.cells(3, 4).Value = "Saturday"
wsNew.Range("D3").Autofill Destination:=wsNew.Range("D3:AH3"), Type:=xlFillWeekdays
With wsNew.Range("D3", "AH3")
.HorizontalAlignment = xlVAlignCenter
End With
ElseIf wsNew.Name = "December" Then
.Value = "December"
wsNew.cells(3, 4).Value = "Thursday"
wsNew.Range("D3").Autofill Destination:=wsNew.Range("D3:AH3"), Type:=xlFillWeekdays
With wsNew.Range("D3", "AH3")
.HorizontalAlignment = xlVAlignCenter
End With
End If
End With
Case "April", "June", "September", "November"
wsNew.Range("D2:E2").Autofill Destination:=wsNew.Range("D2:AG2"), Type:=xlFillSeries
With wsNew.Range("D1", "AG1")
.Font.Bold = True
.Font.Size = 12
.VerticalAlignment = xlVAlignCenter
.HorizontalAlignment = xlVAlignCenter
.MergeCells = True
If wsNew.Name = "April" Then
.Value = "April"
wsNew.cells(3, 4).Value = "Friday"
wsNew.Range("D3").Autofill Destination:=wsNew.Range("D3:AG3"), Type:=xlFillWeekdays
With wsNew.Range("D3", "AH3")
.HorizontalAlignment = xlVAlignCenter
End With
ElseIf wsNew.Name = "June" Then
.Value = "June"
wsNew.cells(3, 4).Value = "Wednesday"
wsNew.Range("D3").Autofill Destination:=wsNew.Range("D3:AG3"), Type:=xlFillWeekdays
With wsNew.Range("D3", "AH3")
.HorizontalAlignment = xlVAlignCenter
End With
ElseIf wsNew.Name = "September" Then
.Value = "September"
wsNew.cells(3, 4).Value = "Thursday"
wsNew.Range("D3").Autofill Destination:=wsNew.Range("D3:AG3"), Type:=xlFillWeekdays
With wsNew.Range("D3", "AH3")
.HorizontalAlignment = xlVAlignCenter
End With
ElseIf wsNew.Name = "November" Then
.Value = "November"
wsNew.cells(3, 4).Value = "Tuesday"
wsNew.Range("D3").Autofill Destination:=wsNew.Range("D3:AG3"), Type:=xlFillWeekdays
With wsNew.Range("D3", "AH3")
.HorizontalAlignment = xlVAlignCenter
End With
End If
End With
Case "February"
wsNew.Range("D2:E2").Autofill Destination:=wsNew.Range("D2:AE2"), Type:=xlFillSeries
With wsNew.Range("D1", "AE1")
.Font.Bold = True
.Font.Size = 12
.VerticalAlignment = xlVAlignCenter
.HorizontalAlignment = xlVAlignCenter
.MergeCells = True
.Value = "February"
wsNew.cells(3, 4).Value = "Tuesday"
wsNew.Range("D3").Autofill Destination:=wsNew.Range("D3:AE3"), Type:=xlFillWeekdays
With wsNew.Range("D3", "AE3")
.HorizontalAlignment = xlVAlignCenter
End With
End With
End Select
'shade in the weekends
For Each rng In wsNew.Range("D3:AH3")
With rng
If rng.Value = "Saturday" Then
wsNew.Columns(.Column).Interior.ColorIndex = 16
ElseIf rng.Value = "Sunday" Then
wsNew.Columns(.Column).Interior.ColorIndex = 16
End If
End With
Next
Next x
rsRoster.Close