Ok alors le mieux est de recopier ce qu'il a prévu dans ses codes
- Allez dans l'éditeur VBA
- A gauche dans VBA project - Microsoft Objects --> vous devez voir votre feuille ENTRETIEN
- Faites un double click dessus et collez le code ci-dessous
Private Sub Worksheet_Activate()
Dim tb, ntb(), k%, i%
If Not Sheets("Liste client").ListObjects(1).DataBodyRange Is Nothing Then
tb = Sheets("Liste client").ListObjects(1).DataBodyRange
k = 0
ReDim ntb(1 To UBound(tb, 1), 1 To 13)
For i = 1 To UBound(tb, 1)
If UCase(tb(i, 15)) = "OUI" Then
ntb(k + 1, 1) = tb(i, 13) 'note
ntb(k + 1, 2) = tb(i, 16) 'note2
ntb(k + 1, 3) = tb(i, 14) 'note3
ntb(k + 1, 4) = tb(i, 19) 'nom & prenom
ntb(k + 1, 7) = tb(i, 8) 'adresse
ntb(k + 1, 8) = tb(i, 9) 'cp
ntb(k + 1, 9) = tb(i, 10) 'ville
ntb(k + 1, 10) = Format(tb(i, 6), "00 00 00 00 00") 'tel1
ntb(k + 1, 11) = Format(tb(i, 7), "00 00 00 00 00") 'tel2
k = k + 1
End If
Next i
If Not Me.ListObjects(1).DataBodyRange Is Nothing Then Me.ListObjects(1).DataBodyRange.Delete
If k > 0 Then Me.ListObjects(1).HeaderRowRange(1).Offset(1, 0).Resize(k, 13) = ntb
End If
'Erase tb: Erase ntb
End Sub
NB : J'ai désactivé l'instruction Erase qui ne sert pas
Retournez sur votre feuille Liste clien
Faites un test en cliquant sur la feuille Entretien
Dites moi si ok