Private Sub Enregistrer_Note_Click()
Dim wsSheet As Worksheet
Dim Lastcell As Range
Dim lastRow As Long, LastCol As Long
Set wsSheet = Sheets("Note")
Set Lastcell = wsSheet.Cells.Find("*", , , , xlByRows, xlPrevious)(2)
If input_note <> "" Then
If wsSheet.Cells(1, 1) <> "" Then 'Recherche du nombre de ligne pour ajouter la nouvelle note apres
'Range Mini / Maxi
lastRow = Lastcell.Row - 1
End If
wsSheet.Cells(lastRow + 1, 1) = Label_EtudiantID.Caption
wsSheet.Cells(lastRow + 1, 2) = Label_Diplome.Caption
wsSheet.Cells(lastRow + 1, 3) = input_note
wsSheet.Cells(lastRow + 1, 4) = input_Coef
Else
MsgBox "Veuillez renseigner la note de l'étudiant."
Exit Sub
End If
Unload Me
End Sub