...
Dim iRow As Integer, iCol As Integer, iTotalCols As Integer
2 iRow = 1
3 iCol = 1
' Array of Headings
' All
4 Call AddToArray(sHeadings, "Total")
5 Call AddToArray(sHeadings, "RespTm PASS")
6 Call AddToArray(sHeadings, "RespTm %")
7 Call AddToArray(sHeadings, "ResolTm PASS")
8 Call AddToArray(sHeadings, "ResolTm %")
9 Call AddToArray(sHeadings, "OVERALL PASS")
10 Call AddToArray(sHeadings, "OVERALL %")
11 Call AddToArray(sHeadings, "ReWorks")
12 Call AddToArray(sHeadings, "CSR PASS")
' SLA
13 Call AddToArray(sHeadings, "SLA Total")
14 Call AddToArray(sHeadings, "SLA RespTm PASS")
15 Call AddToArray(sHeadings, "SLA RespTm %")
16 Call AddToArray(sHeadings, "SLA ResolTm PASS")
17 Call AddToArray(sHeadings, "SLA ResolTm %")
18 Call AddToArray(sHeadings, "SLA OVERALL PASS")
19 Call AddToArray(sHeadings, "SLA OVERALL %")
20 Call AddToArray(sHeadings, "SLA ReWorks")
21 Call AddToArray(sHeadings, "SLA CSR PASS")
' Non-SLA
22 Call AddToArray(sHeadings, "Non-SLA Total")
23 Call AddToArray(sHeadings, "Non-SLA RespTm PASS")
24 Call AddToArray(sHeadings, "Non-SLA RespTm %")
25 Call AddToArray(sHeadings, "Non-SLA ResolTm PASS")
26 Call AddToArray(sHeadings, "Non-SLA ResolTm %")
27 Call AddToArray(sHeadings, "Non-SLA OVERALL PASS")
28 Call AddToArray(sHeadings, "Non-SLA OVERALL %")
29 Call AddToArray(sHeadings, "Non-SLA ReWorks")
30 Call AddToArray(sHeadings, "Non-SLA CSR PASS")
' Array of Formulas
' All
31 Call AddToArray(sFormulas, "=COUNTIFS(tblGlobalData[RegOff],tblOverall[[#This Row],[RegOff]],tblGlobalData[Severity],""<>" + scSeverityFFS + """)")
32 Call AddToArray(sFormulas, "=COUNTIFS(tblGlobalData[RegOff],tblOverall[[#This Row],[RegOff]],tblGlobalData[Severity],""<>" + scSeverityFFS + """,tblGlobalData[Response Time],""PASS"")")
33 Call AddToArray(sFormulas, "=IF(tblOverall[[#This Row],[Total]]>0,tblOverall[[#This Row],[RespTm PASS]]/tblOverall[[#This Row],[Total]],0)")
34 Call AddToArray(sFormulas, "=COUNTIFS(tblGlobalData[RegOff],tblOverall[[#This Row],[RegOff]],tblGlobalData[Severity],""<>" + scSeverityFFS + """,tblGlobalData[Resolution Time],""PASS"")")
35 Call AddToArray(sFormulas, "=IF(tblOverall[[#This Row],[Total]]>0,tblOverall[[#This Row],[ResolTm PASS]]/tblOverall[[#This Row],[Total]],0)")
36 Call AddToArray(sFormulas, "=COUNTIFS(tblGlobalData[RegOff],tblOverall[[#This Row],[RegOff]],tblGlobalData[Severity],""<>" + scSeverityFFS + """,tblGlobalData[OVERALL],""PASS"")")
37 Call AddToArray(sFormulas, "=IF(tblOverall[[#This Row],[Total]]>0,tblOverall[[#This Row],[OVERALL PASS]]/tblOverall[[#This Row],[Total]],0)")
38 Call AddToArray(sFormulas, "=COUNTIFS(tblGlobalData[RegOff],tblOverall[[#This Row],[RegOff]],tblGlobalData[Severity],""<>6"",tblGlobalData[ReWork],""Yes"")")
39 Call AddToArray(sFormulas, "=COUNTIFS(tblGlobalData[RegOff],tblOverall[[#This Row],[RegOff]],tblGlobalData[Severity],""<>6"",tblGlobalData[Customer Satisfaction Rating],""Passed"")")
' SLA
40 Call AddToArray(sFormulas, "=COUNTIFS(tblGlobalData[RegOff],tblOverall[[#This Row],[RegOff]],tblGlobalData[Severity],""<>" + scSeverityFFS + """,tblGlobalData[SLA],""<>"")")
41 Call AddToArray(sFormulas, "=COUNTIFS(tblGlobalData[RegOff],tblOverall[[#This Row],[RegOff]],tblGlobalData[Severity],""<>" + scSeverityFFS + """,tblGlobalData[SLA],""<>"",tblGlobalData[Response Time],""PASS"")")
42 Call AddToArray(sFormulas, "=IF(tblOverall[[#This Row],[SLA Total]]>0,tblOverall[[#This Row],[SLA RespTm PASS]]/tblOverall[[#This Row],[SLA Total]],0)")
43 Call AddToArray(sFormulas, "=COUNTIFS(tblGlobalData[RegOff],tblOverall[[#This Row],[RegOff]],tblGlobalData[Severity],""<>" + scSeverityFFS + """,tblGlobalData[SLA],""<>"",tblGlobalData[Resolution Time],""PASS"")")
44 Call AddToArray(sFormulas, "=IF(tblOverall[[#This Row],[SLA Total]]>0,tblOverall[[#This Row],[SLA ResolTm PASS]]/tblOverall[[#This Row],[SLA Total]],0)")
45 Call AddToArray(sFormulas, "=COUNTIFS(tblGlobalData[RegOff],tblOverall[[#This Row],[RegOff]],tblGlobalData[Severity],""<>" + scSeverityFFS + """,tblGlobalData[SLA],""<>"",tblGlobalData[OVERALL],""PASS"")")
46 Call AddToArray(sFormulas, "=IF(tblOverall[[#This Row],[SLA Total]]>0,tblOverall[[#This Row],[SLA OVERALL PASS]]/tblOverall[[#This Row],[SLA Total]],0)")
47 Call AddToArray(sFormulas, "=COUNTIFS(tblGlobalData[RegOff],tblOverall[[#This Row],[RegOff]],tblGlobalData[Severity],""<>" + scSeverityFFS + """,tblGlobalData[SLA],""<>"",tblGlobalData[ReWork],""Yes"")")
48 Call AddToArray(sFormulas, "=COUNTIFS(tblGlobalData[RegOff],tblOverall[[#This Row],[RegOff]],tblGlobalData[Severity],""<>" + scSeverityFFS + """,tblGlobalData[SLA],""<>"",tblGlobalData[Customer Satisfaction Rating],""Passed"")")
' Non-SLA
49 Call AddToArray(sFormulas, "=COUNTIFS(tblGlobalData[RegOff],tblOverall[[#This Row],[RegOff]],tblGlobalData[Severity],""<>" + scSeverityFFS + """,tblGlobalData[SLA],"""")")
50 Call AddToArray(sFormulas, "=COUNTIFS(tblGlobalData[RegOff],tblOverall[[#This Row],[RegOff]],tblGlobalData[Severity],""<>" + scSeverityFFS + """,tblGlobalData[SLA],"""",tblGlobalData[Response Time],""PASS"")")
51 Call AddToArray(sFormulas, "=IF(tblOverall[[#This Row],[Non-SLA Total]]>0,tblOverall[[#This Row],[Non-SLA RespTm PASS]]/tblOverall[[#This Row],[Non-SLA Total]],0)")
52 Call AddToArray(sFormulas, "=COUNTIFS(tblGlobalData[RegOff],tblOverall[[#This Row],[RegOff]],tblGlobalData[Severity],""<>" + scSeverityFFS + """,tblGlobalData[SLA],"""",tblGlobalData[Resolution Time],""PASS"")")
53 Call AddToArray(sFormulas, "=IF(tblOverall[[#This Row],[Non-SLA Total]]>0,tblOverall[[#This Row],[Non-SLA ResolTm PASS]]/tblOverall[[#This Row],[Non-SLA Total]],0)")
54 Call AddToArray(sFormulas, "=COUNTIFS(tblGlobalData[RegOff],tblOverall[[#This Row],[RegOff]],tblGlobalData[Severity],""<>" + scSeverityFFS + """,tblGlobalData[SLA],"""",tblGlobalData[OVERALL],""PASS"")")
55 Call AddToArray(sFormulas, "=IF(tblOverall[[#This Row],[Non-SLA Total]]>0,tblOverall[[#This Row],[Non-SLA OVERALL PASS]]/tblOverall[[#This Row],[Non-SLA Total]],0)")
56 Call AddToArray(sFormulas, "=COUNTIFS(tblGlobalData[RegOff],tblOverall[[#This Row],[RegOff]],tblGlobalData[Severity],""<>" + scSeverityFFS + """,tblGlobalData[SLA],"""",tblGlobalData[ReWork],""Yes"")")
57 Call AddToArray(sFormulas, "=COUNTIFS(tblGlobalData[RegOff],tblOverall[[#This Row],[RegOff]],tblGlobalData[Severity],""<>" + scSeverityFFS + """,tblGlobalData[SLA],"""",tblGlobalData[Customer Satisfaction Rating],""Passed"")")
58 With ThisWorkbook.Worksheets("Overall")
59 .Select
60 Range("A1").Select
' Fill column A with Header & Unique Values from tblGlobalData tables RegOff column.
61 Sheets("GlobalData").Range("tblGlobalData[[#Headers],[#Data],[RegOff]]").AdvancedFilter _
Action:=xlFilterCopy, CopyToRange:=Range("A1"), Unique:=True
' HEADINGS
62 iTotalCols = UBound(sHeadings) + 1
63 .Cells(iRow, iCol + 1).Resize(, iTotalCols).Value = sHeadings
64 Call CreateTable
' VALUES - Exclude FFS
65 On Error Resume Next
66 iTotalCols = UBound(sFormulas) + 1
67 .Cells(iRow + 1, iCol + 1).Resize(, iTotalCols).FormulaR1C1 = sFormulas
68 On Error GoTo Error_In_ExtraOverall
...