Sub CopyFormat()
Dim Ws As Worksheet
Dim Mws As Worksheet
Dim Ar1 As Areas
Dim Ar2 As Areas
Dim i As Long, j As Long
Set Mws = Sheets("Week")
For Each Ws In Worksheets
Set Ar1 = Ws.Range("B7:B10, B12:B17, B29:B39, D7:D10, D12:D17, D29:D39").Areas
Select Case Ws.Name
Case "Wednesday"
Set Ar2 = Mws.Range("D3:D6, D7:D12, F3:F13, H3:H6, H7:H12, J3:J13").Areas
End Select
If Not Ar2 Is Nothing Then
For i = 1 To Ar2.Count
Ar2(i).Formula = Ar1(i).Formula
For j = 1 To Ar2(i).Count
Ar2(i)(j).Font.Color = Ar1(i)(j).Font.Color
Ar2(i)(j).Font.Bold = Ar1(i)(j).Font.Bold
Next j
Next i
End If
Set Ar1 = Nothing
Set Ar2 = Nothing
Next Ws
'Copy Thursday
For Each Ws In Worksheets
Set Ar1 = Ws.Range("B7:B10, B12:B17, B29:B39, D7:D10, D12:D17, D29:D39").Areas
Select Case Ws.Name
Case "Thursday"
Set Ar2 = Mws.Range("D15:D18, D19:D25, F15:F25, H15:H18, H19:H25, J15:J25").Areas
End Select
If Not Ar2 Is Nothing Then
For i = 1 To Ar2.Count
Ar2(i).Formula = Ar1(i).Formula
For j = 1 To Ar2(i).Count
Ar2(i)(j).Font.Color = Ar1(i)(j).Font.Color
Ar2(i)(j).Font.Bold = Ar1(i)(j).Font.Bold
Next j
Next i
End If
Set Ar1 = Nothing
Set Ar2 = Nothing
Next Ws
'copy friday
For Each Ws In Worksheets
Set Ar1 = Ws.Range("B7:B10, B12:B17, B29:B39, D7:D10, D12:D17, D29:D39").Areas
Select Case Ws.Name
Case "Friday"
Set Ar2 = Mws.Range("D27:D30, D31:D37, F27:F37, H27:H30, H31:H37, J27:J37").Areas
End Select
If Not Ar2 Is Nothing Then
For i = 1 To Ar2.Count
Ar2(i).Formula = Ar1(i).Formula
For j = 1 To Ar2(i).Count
Ar2(i)(j).Font.Color = Ar1(i)(j).Font.Color
Ar2(i)(j).Font.Bold = Ar1(i)(j).Font.Bold
Next j
Next i
End If
Set Ar1 = Nothing
Set Ar2 = Nothing
Next Ws
'copy saturday
For Each Ws In Worksheets
Set Ar1 = Ws.Range("B7:B10, B12:B17, B29:B39, D7:D10, D12:D17, D29:D39").Areas
Select Case Ws.Name
Case "Saturday"
Set Ar2 = Mws.Range("D39:D42, D43:D49, F39:F49, H39:H42, H43:H49, J39:J49").Areas
End Select
If Not Ar2 Is Nothing Then
For i = 1 To Ar2.Count
Ar2(i).Formula = Ar1(i).Formula
For j = 1 To Ar2(i).Count
Ar2(i)(j).Font.Color = Ar1(i)(j).Font.Color
Ar2(i)(j).Font.Bold = Ar1(i)(j).Font.Bold
Next j
Next i
End If
Set Ar1 = Nothing
Set Ar2 = Nothing
Next Ws
'copy sunday
For Each Ws In Worksheets
Set Ar1 = Ws.Range("B7:B10, B12:B17, B29:B39, D7:D10, D12:D17, D29:D39").Areas
Select Case Ws.Name
Case "Sunday"
Set Ar2 = Mws.Range("D51:D54, D55:D61, F51:F61, H51:H54, H55:H61, J51:J61").Areas
End Select
If Not Ar2 Is Nothing Then
For i = 1 To Ar2.Count
Ar2(i).Formula = Ar1(i).Formula
For j = 1 To Ar2(i).Count
Ar2(i)(j).Font.Color = Ar1(i)(j).Font.Color
Ar2(i)(j).Font.Bold = Ar1(i)(j).Font.Bold
Next j
Next i
End If
Set Ar1 = Nothing
Set Ar2 = Nothing
Next Ws
'copy monday
For Each Ws In Worksheets
Set Ar1 = Ws.Range("B7:B10, B12:B17, B29:B39, D7:D10, D12:D17, D29:D39").Areas
Select Case Ws.Name
Case "Monday"
Set Ar2 = Mws.Range("D63:D66, D67:D73, F63:F73, H63:H66, H67:H73, J63:J73").Areas
End Select
If Not Ar2 Is Nothing Then
For i = 1 To Ar2.Count
Ar2(i).Formula = Ar1(i).Formula
For j = 1 To Ar2(i).Count
Ar2(i)(j).Font.Color = Ar1(i)(j).Font.Color
Ar2(i)(j).Font.Bold = Ar1(i)(j).Font.Bold
Next j
Next i
End If
Set Ar1 = Nothing
Set Ar2 = Nothing
Next Ws
'copy Tuesday
For Each Ws In Worksheets
Set Ar1 = Ws.Range("B7:B10, B12:B17, B29:B39, D7:D10, D12:D17, D29:D39").Areas
Select Case Ws.Name
Case "Tuesday"
Set Ar2 = Mws.Range("D75:D78, D79:D85, F75:F85, H75:H78, H79:H85, J75:J85").Areas
End Select
If Not Ar2 Is Nothing Then
For i = 1 To Ar2.Count
Ar2(i).Formula = Ar1(i).Formula
For j = 1 To Ar2(i).Count
Ar2(i)(j).Font.Color = Ar1(i)(j).Font.Color
Ar2(i)(j).Font.Bold = Ar1(i)(j).Font.Bold
Next j
Next i
End If
Set Ar1 = Nothing
Set Ar2 = Nothing
Next Ws
End Sub