1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 | Function recup_var2(namef As String, mm As String, aaaa As Double, Variable As String) As Double
'Base_PSR
Windows(Name_base_PSR).Activate
Sheets("Total").Select
Cells(1, 1).Select
Cells.Find(what:=namef, after:=ActiveCell, searchorder:=xlByColumns, lookat:=xlWhole).Activate
Cells.Find(what:=Variable, after:=ActiveCell, searchorder:=xlByRows, lookat:=xlWhole).Activate
r0 = ActiveCell.Row
Cells(1, 1).Select
Cells.Find(what:=aaaa, after:=ActiveCell, searchorder:=xlByColumns, lookat:=xlWhole).Activate
If mm <> "1" Then
Cells.Find(what:=mm, after:=ActiveCell, searchorder:=xlByColumns, lookat:=xlWhole).Activate
End If
c0 = ActiveCell.Column
If Cells(r0, c0) = "" Then
recup_var = 0
ElseIf Variable = "Encours Total R" Or Variable = "Encours Total B" _
Or Variable = "Encours Sains R" Or Variable = "Encours Sains B" _
Or Variable = "Encours Sensible R" Or Variable = "Encours Sensible B" _
Or Variable = "Encours Douteux R" Or Variable = "Encours Douteux B" _
Or Variable = "Taux de couverture Douteux R" Or Variable = "Taux de couverture Douteux B" _
Or Variable = "Taux de douteux R" Or Variable = "Taux de douteux B" _
Or Variable = "Coût du risque / Encours fin de periode R" Or Variable = "Coût du risque / Encours fin de periode B" _
Then
recup_var = Round(Cells(r0, c0), 4)
End If
Windows(Name_MIRR).Activate
Sheets("Synthese Encours").Select
'Encours TOTAL
Cells(r0, 3) = "Encours Total R"
Cells(r0, 4) = "Encours Total B"
'Encours sains
Cells(r0, 6) = "Encours Sains R"
Cells(r0, 7) = "Encours Total B"
'Encours sensibles
Cells(r0, 9) = "Encours Sensible R"
Cells(r0, 10) = "Encours Sensible B"
'Encours douteux
Cells(r0, 12) = "Encours Douteux R"
Cells(r0, 13) = "Encours Douteux B"
'Taux CDL
Cells(r0, 15) = "Taux de douteux R"
Cells(r0, 16) = "Taux de douteux B"
'Taux couvertures
Cells(r0, 18) = "Taux de couverture Douteux R"
Cells(r0, 19) = "Taux de couverture Douteux B"
'Mise à jour du Titre
Cells(3, 2) = "SYNTHESE ENCOURS" & monthh(dd) & " " & Year(dd)
'Mise à jour du Titre
Cells(3, 8) = monthh(dd) & " " & Year(dd)
Cells(4, 8) = "Budget - " & monthh(ddm1) & " " & Year(ddm1)
Cells(6, 8) = monthh(dd) & " " & Year(dd)
Cells(7, 8) = "Budget - " & monthh(ddm1) & " " & Year(ddm1)
Cells(9, 8) = monthh(dd) & " " & Year(dd)
Cells(10, 8) = "Budget - " & monthh(ddm1) & " " & Year(ddm1)
Cells(12, 8) = monthh(dd) & " " & Year(dd)
Cells(13, 8) = "Budget - " & monthh(ddm1) & " " & Year(ddm1)
Cells(15, 8) = monthh(dd) & " " & Year(dd)
Cells(16, 8) = "Budget - " & monthh(ddm1) & " " & Year(ddm1)
Cells(20, 8) = monthh(dd) & " " & Year(dd)
Cells(21, 8) = "Budget - " & monthh(ddm1) & " " & Year(ddm1)
End Function |
Partager