Sub aCLosed572()
Sheets("Calculations").Select
Rows("1:9").Select
Application.CutCopyMode = False
Selection.ClearContents
Columns("A:O").Select
Range("O1").Activate
Selection.ClearContents
Sheets("Working Data").Select
Columns("A:O").Select
Range("O1").Activate
Selection.ClearContents
Sheets("Data").Select
Rows("1:1").Select
Selection.AutoFilter
' Note the 25,123 is used as I do have up to 25,000 records .
ActiveSheet.Range("$A$1:$H$25123").AutoFilter Field:=1
ActiveSheet.Range("$A$1:$H$25123").AutoFilter Field:=2
ActiveSheet.Range("$A$1:$H$25123").AutoFilter Field:=3
ActiveSheet.Range("$A$1:$H$25123").AutoFilter Field:=4
ActiveSheet.Range("$A$1:$H$25123").AutoFilter Field:=5
ActiveSheet.Range("$A$1:$H$25123").AutoFilter Field:=6
ActiveSheet.Range("$A$1:$H$25123").AutoFilter Field:=7
ActiveSheet.Range("$A$1:$H$25123").AutoFilter Field:=6, Operator:=xlFilterValues, Criteria2:=Array(2, _
"11/22/2023", 2, "11/23/2023", 2, "11/24/2023", 2, "11/25/2023", 2, "11/26/2023", 2, "11/27/2023", 2, "11/28/2023", 2, "11/29/2023", 2, "11/30/2023", 2, "12/1/2023", 2, "12/2/2023", 2, "12/3/2023", 2, "12/4/2023", 2, "12/5/2023", 2, "12/6/2023", 2, "12/7/2023", 2, "12/8/2023", 2, "12/9/2023", 2, "12/10/2023", 2, "12/11/2023", 2, "12/12/2023", 2, "12/13/2023", 2, "12/14/2023", 2, "12/15/2023", 2, "12/16/2023", 2, "12/17/2023", 2, "12/18/2023", 2, "12/19/2023", 2, "12/20/2023", 2, "12/21/2023", 2, "12/22/2023", 2, "12/23/2023", 2, "12/24/2023", 2, "12/25/2023", 2, "12/26/2023")
Columns("A:O").Select
Range("O1").Activate
Selection.Copy
' This sets up the first of 14 weeks. There are 35 dates as I use 5 weeks worth of data as a moving "month" for each of the 14 weeks
Sheets("Working Data").Select
Range("A1").Select
ActiveSheet.Paste
Range("A1:D1").Select
Application.CutCopyMode = False
Selection.AutoFilter
' Note the 7,012 is adjusted for the max size of each of the 39 geographic areas.
ActiveSheet.Range("$A$1:$D$7012").AutoFilter Field:=1, Criteria1:=Array( _
"Alameda", "Contra Costa", "Marin", "Napa", "San Francisco", "San Mateo", "Santa Clara", "Solano", "Sonoma"), Operator:=xlFilterValues
Columns("A:O").Select
Selection.Copy
Sheets("Calculations").Select
Range("A10").Select
ActiveSheet.Paste
Sheets("Formulas").Select
Rows("1:9").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Calculations").Select
Range("A1").Select
ActiveSheet.Paste
Range("F2:BI2").Select
Application.CutCopyMode = False
Selection.Copy
' Note "Bay Area" is the 1st of 39 output sheets and the 572 is the row assigned this week's data.
Sheets("Bay Area").Select
Range("F572").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Sheets("Calculations").Select
Application.Goto Reference:="R1C15"
Columns("A:O").Select
Range("O1").Activate
Application.CutCopyMode = False
Selection.ClearContents
Sheets("Working Data").Select
' Note this is where the macro is looped back up to step just below "Working Data" line below the 35 dates.
Bookmarks