Private Sub Worksheet_Change(ByVal Target As Range)
Dim LigNew As Long
Application.EnableEvents = False
On Error Resume Next
If Not Intersect(Target, Range("B11:B" & Range("B" & Rows.Count).End(xlUp).Row)) Is Nothing Then
Target.Value = UCase(Mid(Target.Value, 1, InStr(1, Target.Value, " ") + 1)) & LCase(Mid(Target.Value, InStr(1, Target.Value, " ") + 2, Len(Target.Value) - InStr(1, Target.Value, " ") + 1))
' Inscrire un indicateur de nouvellement saisi dans la colonne O
Range("O" & Target.Row) = "New"
' Faire le tri du tableau avec la colonne O en plus
'Range("A11:N" & Range("B" & Rows.Count).End(xlUp).Row).Sort key1:=Range("B11"), header:=xlYes
Range("A11:O" & Range("B" & Rows.Count).End(xlUp).Row).Sort key1:=Range("B11"), header:=xlYes
End If
For i = 11 To Range("B" & Rows.Count).End(xlUp).Row
Range("A" & i).Value = i - 10
Next i
' Retrouver le nom qui vient d'être saisi grace à l'indicateur
LigNew = Range("O:O").Find(What:="New").Row
' Se positionner sur la ligne
Range("C" & LigNew).Select
' On, peut effacer l'indicateur
Range("O" & LigNew).ClearContents
'
Application.EnableEvents = True
End Sub
Ce message est de : http://excel.veriti.net/modules/newbb/viewtopic.php?post_id=333