Hallo Mick,
nachfolgender VBA-Code sollte das machen, was Du Dir vorgestellt hast. Tausche ihn gegen Deinen vorhandenen Code aus.
Teste den Code aber bitte in einer Testdatei und nicht gleich in Deiner Originaldatei.
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim strWort() As String
Dim strText As String
Dim intWortIndex As Integer
If IsEmpty(Target) Then Exit Sub
If Intersect(Target, Range("D5")) _
Is Nothing Then Exit Sub
Application.EnableEvents = False
On Error GoTo ERRORHANDLER
strWort = Split(Target, " ")
For intWortIndex = 0 To UBound(strWort)
If strWort(intWortIndex) <> "Wwe." And strWort(intWortIndex) <> "Ehefr." And _
strWort(intWortIndex) <> "gnt." And strWort(intWortIndex) <> "sive." Then
strText = strText & " " & UCase(strWort(intWortIndex))
Else
strText = strText & " " & strWort(intWortIndex)
End If
Next
Target = Mid(strText, 2, Len(strText))
ERRORHANDLER:
Application.EnableEvents = True
End Sub
MfG,
Oliver
[sub]Da hier der einzige Lohn für die Helfer eine Rückmeldung ist, wäre es nett, wenn Du[/sub]
[sup] ein Feedback abgeben könntest, ob der Lösungsvorschlag Dein Problem gelöst hat.[/sup]