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 48 49 50 51 52 53 54 55 56 57 58
| Dim TabVal3()
Dim CoinG As Range
Dim TabParametres(11)
'ouvrir le fichier de donnees PnL Explain
Set xlBook2 = Application.Workbooks.Open(str2, , True)
Set OtherBook = Workbooks(ThisWorkbook.Sheets("Lien fichiers").Cells(3, 3).Value)
'determiner les lignes du TableauPnL explaination
CurBook.Worksheets("P&L").Activate
' selection des parametres
'taille tableau TabVal3 28 perimetres et 12 parametres
ReDim TabVal3(28, 1)
'copie des perimetres dans le tableau
With ActiveSheet
ReDim Preserve TabVal3(28, 13)
TabVal3 = Range(.Cells(43, 1), .Cells(70, 1))
End With
'determiner le tableau du fichier PnL explaination
'determiner les lignes du Tableau Breach
OtherBook.Worksheets("PnL explanations").Activate
ActiveSheet.UsedRange.Select
Set CoinG = Selection.Find(what:="GV group")
Set Group = Selection.FindNext(CoinG)
LineG = Group.Row
ColG = (Group.Column) - 1 'pour avoir le coin gauche
'nettoyer avant
'Plage du tableau nommé Frange
DerCol = Cells(LineG, ColG).End(xlToRight).Column
DerCellLine = Cells(LineG, ColG).End(xlDown).Row 'ligne celulle
Set Frange = Range(Cells(LineG, ColG), Cells(DerCellLine, DerCol))
strrr = Frange.Address
'selection de la ressource
OtherBook.Worksheets("PnL explanations").Activate
'tableau des parametres
TabParametres(1) = "P&L": TabParametres(2) = "New deals": TabParametres(3) = "Modification"
TabParametres(4) = "IR Delta": TabParametres(5) = "IR Delta Adj": TabParametres(6) = "Theta"
TabParametres(7) = "Basis Swap Delta": TabParametres(8) = "Spread impact"
TabParametres(9) = "FX": TabParametres(10) = "FX Delta"
TabParametres(11) = "Daily Brokerage"
For j = 2 To 12
ColCritere1 = Frange.Find(TabParametres(j - 1)).Column
For i = 1 To 28 ' le nombre de perimetres
LineCritere1 = Frange.Find(TabVal3(i, 1)).Row
'recuperer valeur
TabVal3(i, j) = Cells(LineCritere1, ColCritere1).Value
'copier dans tableau
Next i
Next j |
Partager