Bonjour,
Petit pb bizarre. A essayer :
Si problème, le code est le suivant :
Dans la feuille "cours" :
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Sheets("saisie").Cells(5, 3) = Target.Value
Sheets("saisie").Activate
End Sub
Dans la feuille "saisie" :
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim nL As Integer, wS1 As Worksheet, wS2 As Worksheet
Dim index As String, i As Integer, j As Integer
nL = Sheets("saisie").Cells(Rows.Count, "B").End(xlUp).Row ' Lignes contenant le nom d'un élève
If Target.Column < 6 Or Target.Column > 6 Or Target.Row < 9 Or Target.Row > nL Then Exit Sub
Set wS1 = Sheets("bd")
Set wS2 = Sheets("saisie")
index = wS2.Cells(Target.Row, 1)
nL = wS1.Cells(Rows.Count, "B").End(xlUp).Row
' On recherche la ligne dans la bd
For i = 2 To nL
If wS1.Cells(i, 1) = index Then
For j = 6 To 9
If wS1.Cells(1, j) = wS2.Range("$C$5") Then
wS1.Cells(i, j) = Target.Value
wS1.Cells(i, j).HorizontalAlignment = xlCenter
End If
Next j
Exit For
End If
Next i
wS1.Activate
End Sub