R1-
XLDnaute Junior
		VB:
	
	
	Sub MEF()
Dim f As Variant
f = Array("FRANCE", "CORDON", "PORTUGAL", _
                              "BELGIQUE", "ESPAGNE", "SUISSE", _
                              "ITALIE", "HS_CORDON")
Application.ScreenUpdating = False
    For Each Feuille In f
        With Worksheets(Feuille)
            If .[C1] <> vbNullString Then .[A:A,C:H,J:P].Delete shift:=xlToLeft
        End With
    Next
 
If Sheets("portefeuille").[C1] <> vbNullString Then Sheets("portefeuille").Range("A:G,J:L").Delete shift:=xlToLeft
 
Call CONSO
End Sub
Sub CONSO()
Dim fichier As String
fichier = ActiveWorkbook.Path & "\[" & ActiveWorkbook.Name & "]"
Dim slct As String
slct = "R1C1:R1000C2"
Sheets("CPA").Range("A1").Consolidate Sources:=Array("'" & fichier & "FRANCE'!" & slct, _
                                "'" & fichier & "CORDON'!" & slct, _
                                "'" & fichier & "PORTUGAL'!" & slct, _
                                "'" & fichier & "ESPAGNE'!" & slct, _
                                "'" & fichier & "BELGIQUE'!" & slct, _
                                "'" & fichier & "SUISSE'!" & slct, _
                                "'" & fichier & "ITALIE'!" & slct, _
                                "'" & fichier & "HS_CORDON'!" & slct), Function:=xlSum, TopRow:=True, LeftColumn:=True, CreateLinks:=False
                                
Sheets("PPA").Range("A1").Consolidate Sources:=Array("'" & fichier & "Portefeuille'!" & slct), Function:=xlSum, TopRow:=True, LeftColumn:=True, CreateLinks:=False
Call portefeuille
MsgBox "done"
End Sub
Sub portefeuille()
Dim L As Integer, Plage As Range
    L = 2
    Set Plage = Sheets("PPA").Range("A2:B" & Range("A65500").End(xlUp).Row) 'définir la plage de A2 a B de la dernière ligne
    
    With Sheets("CPA")
        While Sheets("CPA").Cells(L, "A") <> "" 'tant que A n'est pas vide
            On Error Resume Next
            Sheets("CPA").Cells(L, "C") = Sheets("CPA").Cells(L, "B") - Application.VLookup(Sheets("CPA").Cells(L, "A"), Plage, 2, 0)
            L = L + 1
        Wend
    End With
    
End Sub
	Bonjour, ci dessus vous trouverez un code qui me pose un problème sur lequel je m'arrache les cheveux. En effet, la macro "portefeuille" qui est call par la macro "CONSO" ne marche pas lorsque'elle est call mais marche très bien lorsqu'elle est exécuté seule.
Avez vous une idée quant a l'origine du problème.
merci par avance pour vos réponses.