bonjour amadéus
effectivement cela marche avec cette feuille
par contre je cherche à inserer ce code dans une autre feuille qui a déjà la fonction
Private Sub Worksheet_Change(ByVal Target As Range)
Dim x As String, y As String, i As Integer
Application.EnableEvents = False
On Error Resume Next
If Not Intersect(Target, Range("B11:B" & Range("B" & Rows.Count).End(xlUp).Row)) Is Nothing Then
x = 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))
Target.Value = x
Range("A11:S" & 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
y = Range("B11:B" & Range("B" & Rows.Count).End(xlUp).Row).Find(x).Address
Range(y).Select
Application.EnableEvents = True
Dim plage As Range
Dim lig As Byte
With Sheets("Feuil1")
i = 19
While i < 50 'Cells(5, i) <> "" And
lig = i
Set plage = .Range(Cells(lig, 2), Cells(lig, 5))
Select Case .Range("S11" & i).Value
Case Is = "Sandbox"
plage.Interior.ColorIndex = 19 'Jaune pâle pour "En attente"
Case Is = "Delivery"
plage.Interior.ColorIndex = 27 'Jaune foncé pour "Déclinée"
Case Is = "Factory"
plage.Interior.ColorIndex = 3 'Rouge pour "Perdue"
Case Else
plage.Interior.ColorIndex = -4142 ' enlève la couleur
End Select
i = i + 1
Wend
End With
End Sub
je n'arrive pas inserer cet code
bref en colonne R les cellules sont formatées en personnalisé 0#"/"0#"/"#### pour n'entre que les chiffres
si tu as une solution
en te remerciant par avance