Re,
Où est ton code VBA ??? Ton fichier excel est un xlsx et ne comporte donc pas de code !
As-tu  fait des essais avec le fichier que je t'ai transmis dans le post#2 ? (moyenne filtrée.xlsx)
A bientôt
        
        
     
Bonjour  AtTheOne,
Oui j'ai fais un test avec le fichier que tu m'as transmit et les filtres marchent très bien mais je n'arrive pas à l'associer a mon code vba que voici:
Sub ExporterVersPPT()
    Dim ws As Worksheet
    Dim lastRow As Long
    Dim sumNotes As Double
    Dim countNotes As Long
    Dim moyenne As Double
    Dim PPApp As Object
    Dim PPTPrésentation As Object
    Dim slide As Object
    Dim slideIndex As Integer
    Dim codeStart As String
    Dim cell As Range
    ' Définir la feuille de calcul
    Set ws = ThisWorkbook.Sheets("EvaluationCampus")
    ' Ouvrir PowerPoint s'il n'est pas déjà ouvert
    On Error Resume Next
    Set PPApp = GetObject(, "PowerPoint.Application")
    On Error GoTo 0
    If PPApp Is Nothing Then
        Set PPApp = CreateObject("PowerPoint.Application")
    End If
    PPApp.Visible = True
   
    ' Ouvrir la présentation PowerPoint existante ou créer une nouvelle présentation
    On Error Resume Next
    Set PPTPrésentation = PPApp.Presentations("ppt5E35 (2).pptx")
    On Error GoTo 0
    If PPTPrésentation Is Nothing Then
        Set PPTPrésentation = PPApp.Presentations.Open(ThisWorkbook.Path & "\ppt5E35 (2).pptx")
    End If
    ' Boucle pour chaque diapositive pour enlever les pieds de page
    For Each slide In PPTPrésentation.Slides
        For Each Shape In slide.Shapes
            If Shape.Type = msoPlaceholder Then
                If Shape.PlaceholderFormat.Type = ppPlaceholderFooter Then
                    Shape.Delete
                End If
            End If
        Next Shape
    Next slide
    ' Trouver la dernière ligne avec des données dans la colonne C
    lastRow = ws.Cells(ws.Rows.Count, "C").End(xlUp).Row
    ' Parcourir chaque code start unique
    For Each cell In ws.Range("C2:C" & lastRow).SpecialCells(xlCellTypeConstants).Cells
        codeStart = cell.Value
        ' Filtrer les données par le code start
        ws.Range("A1:C" & lastRow).AutoFilter Field:=3, Criteria1:=codeStart
        ' Calculer la moyenne des notes filtrées dans la colonne A
        sumNotes = Application.WorksheetFunction.Sum(ws.Range("A2:A" & lastRow).SpecialCells(xlCellTypeVisible))
        countNotes = Application.WorksheetFunction.Count(ws.Range("A2:A" & lastRow).SpecialCells(xlCellTypeVisible))
        If countNotes > 0 Then
            moyenne = sumNotes / countNotes
        Else
            moyenne = 0
        End If
        ' Insérer la moyenne dans la diapositive correspondante
        slideIndex = GetSlideIndexByCodeStart(PPTPrésentation, codeStart)
        If slideIndex > 0 Then
            With PPTPrésentation.Slides(slideIndex).Shapes("RectangleNoteMoy").TextFrame.TextRange
                .Text = Format(moyenne, "0.00")
                .Font.Bold = msoTrue
                .Font.Color = RGB(0, 112, 192) ' Bleu
                .ParagraphFormat.Alignment = 1 ' Alignement à gauche
                .Font.Size = 28 ' Ajuster la taille de la police
            End With
        End If
        ' Réinitialiser le filtre
        ws.AutoFilterMode = False
    Next cell
    ' Enregistrer la mise à jour
    PPTPrésentation.Save
    MsgBox "La présentation PowerPoint a été mise à jour.", vbInformation, "Avis sur la Formation"
End Sub
Function GetSlideIndexByCodeStart(presentation As Object, codeStart As String) As Integer
    ' Fonction pour obtenir l'index de la diapositive correspondant au code start
    Dim slide As Object
    For Each slide In presentation.Slides
        If slide.Shapes.HasTitle Then
            If slide.Shapes.Title.TextFrame.TextRange.Text = codeStart Then
                GetSlideIndexByCodeStart = slide.slideIndex
                Exit Function
            End If
        End If
    Next slide
    GetSlideIndexByCodeStart = -1 ' Retourne -1 si aucun slide ne correspond
End Function