rsRecordset15.Open "select ESASKSIZE AS ESASKSIZE,ESBIDSIZE AS ESBIDSIZE from DBO.DEMANDSPREAD WITH (NOLOCK) WHERE ESASKSIZE > '' AND ESBIDSIZE > '' AND TIMESTAMP BETWEEN DATEADD(mi, -40, " & "'" & DSMAXTS & "'" & ") AND " & "DATEADD(ss, -1," & "'" & DSMAXTS & "'" & " )ORDER BY TIMESTAMP ASC", gcnConnect, adOpenKeyset, adLockReadOnly
If Not rsRecordset15.EOF Then
cell1 = rsRecordset15.RecordCount
Call Sheet4.Range("A2").CopyFromRecordset(rsRecordset15) 'ESASKSIZE
End If
rsRecordset15.Close
Sheet6.Range("C3") = Sheet4.Cells(cell1 + 1, 11)
Sheet6.Range("D3") = Sheet4.Cells(cell1 + 1, 12)
Sheet6.Range("E3") = Sheet4.Cells(cell1 + 1, 13)
Sheet6.Range("C4") = Sheet4.Cells(cell1 + 1, 14)
Sheet6.Range("D4") = Sheet4.Cells(cell1 + 1, 15)
Sheet6.Range("E4") = Sheet4.Cells(cell1 + 1, 16)
Sheet6.Range("C5") = Sheet4.Cells(cell1 + 1, 5)
Sheet6.Range("C6") = Sheet4.Cells(cell1 + 1, 8)