1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| 'On charge ici les deux tableaux de coefs
'Dates des deux MàJ ds coef ROP
Dim UpdateROPNBI As Date
Dim UpdateROPPO As Date
For k = 0 To 4
UpdateROPNBI = DateSerial(Year(AsOf), 1, 1)
UpdateROPPO = DateSerial(Year(AsOf) - 1, 12, 1)
If CLng(DateAdd("m", -3 * k, AsOf)) < CLng(UpdateROPNBI) Then
UpdateROPNBI = DateSerial(Year(AsOf) - 1, 1, 1)
End If
If CLng(DateAdd("m", -3 * k, AsOf)) < CLng(UpdateROPPO) Then
UpdateROPPO = DateSerial(Year(AsOf) - 2, 12, 1)
End If
myreq = "Select Mnemo, Val FROM tbRWA_Params WHERE AsOf = " & CLng(UpdateROPNBI) & " AND Type = 'ROP NBI'"
rs.Open myreq, cn
If Not rs.EOF Then
ROP_NBI = rs.GetRows()
End If
rs.Close
myreq = "Select Mnemo, Val FROM tbRWA_Params WHERE AsOf = " & CLng(UpdateROPPO) & " AND Type = 'ROP Pertes OP'"
rs.Open myreq, cn
If Not rs.EOF Then
ROP_OP = rs.GetRows()
End If
rs.Close
Dim ROP_Coef() As Variant
ReDim ROP_Coef(UBound(ROP_NBI, 2))
'On croise les deux tableaux de coef ici:
For i = LBound(ROP_NBI, 2) To UBound(ROP_NBI, 2)
ROP_Coef(0, i) = ROP_NBI(0, i)
ROP_Coef(1, i) = ROP_NBI(1, i)
ROP_Coef(2, i) = ROP_OP(1, i)
Next i
For i = 0 To 3
Worksheets("Retr RWA ROP by PC").Cells(17, 31 + i + k * 5).Value = Worksheets("Retr RWA ROP by PC").Cells(17, 6 + i + k * 5).Value
Worksheets("Retr RWA ROP by PC").Cells(17, 31 + i + k * 5).ColumnWidth = 8.43
Next i |
Partager