This is the module I was handed down.
Sub Test2()
Dim rst As ADODB.Recordset
Dim appROneHours As Excel.Application
Dim wkbROneHours As Excel.Workbook
Dim TaskArray(1 To 12) As Variant
TaskArray(1) = "01 - Design"
TaskArray(2) = "02 - Code Generation"
TaskArray(3) = "03 - Configuration Mgmt"
TaskArray(4) = "04 - Cold Testing"
TaskArray(5) = "05 - Hot Testing"
TaskArray(6) = "06 - Requirements Management"
TaskArray(7) = "07 - Planning/Tracking"
TaskArray(8) = "08 - SQA"
TaskArray(9) = "09 - Peer Reviews"
TaskArray(10) = "10 - Installation Labor"
TaskArray(11) = "11 - Shipboard Testing"
TaskArray(12) = "12 - Supplier Agreement"
Set rst = New ADODB.Recordset
rst.Open "releases", CurrentProject.Connection, adOpenStatic
Set appROneHours = CreateObject("Excel.Application")
appROneHours.Application.Workbooks.Add
Set wkbROneHours = appROneHours.Application.ActiveWorkbook
With wkbROneHours
If rst.RecordCount >= 3 Then
For C = 1 To rst.RecordCount - 2
wkbROneHours.Worksheets.Add After:=.Worksheets(.Worksheets.Count)
Next C
End If
For R = 1 To rst.RecordCount
strRelNum = R
With .Worksheets(R)
rst.Find "ID = " & R
.name = rst.Fields("release")
.Cells(1, 2) = .name
For T = 1 To 12
strCriteria = TaskArray(T)
.Cells(T + 2, 3) = DSum("[Hours]", "[AllTasks]", "[Task] = """ & strCriteria & """ AND [Release] = """ & strRelNum & """")
.Cells(T + 2, 5) = FormatCurrency(DSum("[payrate] * [Hours]", "[AllTasks]", "[Task] = """ & strCriteria & """ AND [Release] = """ & strRelNum & """"), 2)
.Cells(T + 2, 4) = DSum("[""" & strCriteria & "h""]", "[PredictedValues]", "[release] = """ & strRelNum & """")
.Cells(T + 2, 6) = FormatCurrency(DSum("[""" & strCriteria & "f""]", "[PredictedValues]", "[release] = """ & strRelNum & """"))
If IsEmpty(.Cells(T + 2, 3)) = True Then
.Cells(T + 2, 3).Value = 0
End If
If IsEmpty(.Cells(T + 2, 5)) = True Then
.Cells(T + 2, 5).Value = FormatCurrency(0)
End If
Next T
End With
Next R
With .Worksheets(.Worksheets.Count)
.name = "MCM Totals"
.Cells(1, 2) = .name
For T = 1 To 12
strCriteria = TaskArray(T)
.Cells(T + 2, 3) = DSum("[Hours]", "[AllTasks]", "[Task] = """ & strCriteria & """")
.Cells(T + 2, 5) = FormatCurrency(DSum("[payrate] * [Hours]", "[AllTasks]", "[Task] = """ & strCriteria & """"), 2)
.Cells(T + 2, 4) = DSum("[""" & strCriteria & "h""]", "[PredictedValues]")
.Cells(T + 2, 6) = FormatCurrency(DSum("[""" & strCriteria & "f""]", "[PredictedValues]"))
If IsEmpty(.Cells(T + 2, 3)) = True Then
.Cells(T + 2, 3).Value = 0
End If
If IsEmpty(.Cells(T + 2, 5)) = True Then
.Cells(T + 2, 5).Value = FormatCurrency(0)
End If
Next T
End With
For W = 1 To .Worksheets.Count
With .Worksheets(W)
Set rngC = .Range("C3:C14")
Set rngD = .Range("D3

14")
Set rngE = .Range("E3:E14")
Set rngF = .Range("F3:F14")
.Cells(2, 2) = "Task"
.Cells(2, 3) = "Hours"
.Cells(2, 4) = "Predicted Hours"
.Cells(2, 5) = "Funds"
.Cells(2, 6) = "Predicted Funds"
.Range("B1").Font.Size = 18
.Range("B1:F2").Font.Bold = True
.Range("B2:F2").Interior.Color = RGB(200, 200, 200)
.Range("B2:B14").ColumnWidth = 23
rngC.ColumnWidth = 10.75
rngD.ColumnWidth = 14.86
rngE.ColumnWidth = 11
rngF.ColumnWidth = 15.15
.Cells(3, 2) = "Design"
.Cells(4, 2) = "Code Generation"
.Cells(5, 2) = "Configuration Mgmt."
.Cells(6, 2) = "Cold Testing"
.Cells(7, 2) = "Hot Testing"
.Cells(8, 2) = "Requirements Management"
.Cells(9, 2) = "Planning/Tracking"
.Cells(10, 2) = "SQA"
.Cells(11, 2) = "Peer Reviews"
.Cells(12, 2) = "Installation Labor"
.Cells(13, 2) = "Shipboard Testing"
.Cells(14, 2) = "Supplier Agreement"
.Cells(15, 3) = WorksheetFunction.Sum(rngC)
.Cells(15, 4) = WorksheetFunction.Sum(rngD)
.Cells(15, 5) = FormatCurrency(WorksheetFunction.Sum(rngE))
.Cells(15, 6) = FormatCurrency(WorksheetFunction.Sum(rngF))
.Range("C15:F15").Borders.Item(xlEdgeTop).Color = RGB(0, 0, 0)
.Range("C15:F15").Borders.Item(xlEdgeTop).Weight = xlMedium
End With
.Charts.Add After:=Worksheets(W)
.ActiveChart.ChartType = xlColumnClustered
.ActiveChart.SeriesCollection.Add Worksheets(W).Range("B2

14")
.ActiveChart.HasLegend = True
.ActiveChart.HasDataTable = False
.ActiveChart.HasTitle = False
.ActiveChart.name = .Worksheets(W).name & " Hours"
.ActiveChart.PlotArea.Interior.Color = RGB(200, 180, 180)
.ActiveChart.Axes(xlCategory).TickLabels.Orientation = 45
.ActiveChart.Axes(xlCategory).TickLabelSpacing = 1
.ActiveChart.SeriesCollection(1).Interior.Color = RGB(0, 100, 0)
.ActiveChart.SeriesCollection(2).Interior.Color = RGB(100, 0, 100)
.Charts.Add Before:=Worksheets(W)
.ActiveChart.ChartType = xlColumnClustered
.ActiveChart.SeriesCollection.Add Worksheets(W).Range("E2:F14")
.ActiveChart.HasLegend = False
.ActiveChart.HasDataTable = False
.ActiveChart.HasTitle = False
.ActiveChart.name = .Worksheets(W).name & " Funds"
.ActiveChart.PlotArea.Interior.Color = RGB(200, 180, 180)
.ActiveChart.SeriesCollection(1).Interior.Color = RGB(0, 155, 0)
.ActiveChart.Axes(xlCategory).TickLabels.Orientation = 45
.ActiveChart.Axes(xlCategory).TickLabelSpacing = 1
.ActiveChart.Axes(xlCategory).CategoryNames = Worksheets(W).Range("B3:B14")
Next W
End With
appROneHours.Visible = True
rst.Close
Set appROneHours = Nothing
Set wkbROneHours = Nothing
End Sub