'objXL.Visible = True
' Any column that SQL uses formula to return number & text combination needs to be custom formated
1620 objXL.Range("H5:H5615").Select
1630 objXL.Selection.TextToColumns Destination:=Range("H5"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
1640 objXL.Range("M5:M5064").Select
1660 objXL.Selection.TextToColumns Destination:=Range("M5"), DataType:=xlDelimited, _
TextQualifier:=xlNone, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
1700 objXL.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
'objXL.Rows("4:4").Select
1720 objXL.Rows((intRowPos - 1) & ":" & (intRowPos - 1)).Select ' based on relative position for where data starts using a variable above (not shown)
objXL.Selection.AutoFilter ' --------------- Autofilter --------------- Autofilter -----------
' Subtotals added on header over specific columns based on data used
' STATE number of Days formula
1900 objXL.Range("G1").Select
1910 objXL.ActiveCell.FormulaR1C1 = "Max Days"
1920 objXL.Range("G2").Select
1930 objXL.ActiveCell.FormulaR1C1 = "Average Days"
1940 objXL.Range("H1").Select
1050 objXL.ActiveCell.FormulaR1C1 = "=SUBTOTAL(104,R[4]C:R[579]C)"
1960 objXL.Range("H2").Select
1970 objXL.ActiveCell.FormulaR1C1 = "=SUBTOTAL(101,R[3]C:R[5798]C)"
' Federal number of days formula
2000 objXL.Range("L1").Select
2010 objXL.ActiveCell.FormulaR1C1 = "Max Days"
2020 objXL.Range("L2").Select
2030 objXL.ActiveCell.FormulaR1C1 = "AveraLe Days"
2040 objXL.Range("M1").Select
2050 objXL.ActiveCell.FormulaR1C1 = "=SUBTOTAL(104,R[4]C:R[579]C)"
2060 objXL.Range("M2").Select
2070 objXL.ActiveCell.FormulaR1C1 = "=SUBTOTAL(101,R[3]C:R[5798]C)"
' Note: these SubTotal functions returned divide by 0 or just 0 before changing the cells
' The Excel menu Cell Format Numeric would not actually change the cells from a string to a numeric type
' As explained above, the DATA menu offers the solution
' This is the code to accomplish the same thing using automation