Noms majuscule 1er lettre prenom minuscule

bonjour

j'ai un classeur avec en colonne B des noms et prenoms . Est il possible d'avoir une fonction permettant d'automatiser les majuscules pour nom et majuscule 1er lettre pour prenom et ceci de B11 à B500

par avance merci

186maj.xls (13.50 Ko)

En D11 Tu mets

=si(B11<>"";MAJUSCULE(GAUCHE(B11;TROUVE(" ";B11)+1)) & MINUSCULE(STXT(B11;TROUVE(" ";B11)+2;NBCAR(B11)-TROUVE(" ";B11)+1));"")

puis tu traines

Bonjour,

Une autre alternative :

=MAJUSCULE(GAUCHE(B11;TROUVE(" ";B11)))&NOMPROPRE(DROITE(B11;NBCAR(B11)-TROUVE(" ";B11)))

cdt

Bonjour,

Et une autre...

=MAJUSCULE(STXT(B11;1;TROUVE(" ";B11)))&NOMPROPRE(STXT(B11;TROUVE(" ";B11)+1;NBCAR(B11)))

merci

mais j'ai fait une erreur

à partir de la ligne B11 jusqu'à la ligne B500 je voudrais que ces cellules , lorsque je tape le nom et prenom se mettent automatiquement en NOM Prénom (maj et 1er lettre Maj prénom) dès sortie de cellule

merci

Re,

Un exemple à adapter suivant besoins.

Cdlt

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim tmp
Dim x As String
    If Not Application.Intersect(Target, Range("B11:B500")) Is Nothing Then
        If Target.Count > 1 Then Exit Sub
        On Error GoTo fin
        Application.EnableEvents = False
        tmp = Split(Target, " ")
        x = UCase(tmp(0))
        x = x & " " & Application.Proper(tmp(1))
        Target = x
    End If
    Application.EnableEvents = True
    Exit Sub
fin:
    Application.EnableEvents = True
End Sub
103anaxagore-v1.zip (8.85 Ko)

A mettre dans le module de la feuille en question

Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("B11:B500")) 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))
    End If
End Sub

en fait j'ai dejà worksheet_change (voir ci dessous) ..peut on rajouter le code pour les majuscules , de mon coté ca passe pas

merci pour les reponses

Private Sub Worksheet_Change(ByVal Target As Range)

Application.EnableEvents = False

If Not Intersect(Target, Range("B11:B" & Range("B" & Rows.Count).End(xlUp).Row)) Is Nothing Then

Range("A11:N" & 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

Application.EnableEvents = True

End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
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))
Range("A11:N" & 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

Application.EnableEvents = True
end sub

magnifique

merci mille fois


est il possible une fois le nom rajouté et trié que le curseur se positionne directement sur cette nouvelle cellule et nouvelle ligne.

si possible merci beaucoup

Private Sub Worksheet_Change(ByVal Target As Range)
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:N" & 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
ici = Range("B11:B" & Range("B" & Rows.Count).End(xlUp).Row)).find(x).address
Range(ici).select

Application.EnableEvents = True
end sub
Rechercher des sujets similaires à "noms majuscule 1er lettre prenom minuscule"