Umlaute zählen

String-Verarbeitung
Private AnzahlÄ%, AnzahlÖ%, AnzahlÜ%
Andere Möglichkeit:
Private Sub txtTextfeld_Change() Private Sub txtTextfeld_Change()
  UmlauteTesten txtTextfeld.Text   Call UmlauteTesten
End Sub End Sub
 
Sub UmlauteTesten(tmpText As String) Private Sub UmlauteTesten()
Dim n As Long, c As String * 1
AnzahlÄ = 0: AnzahlÖ = 0: AnzahlÜ = 0 Zähler auf Null stellen.
 For n = 1 To Len(txtTextfeld.Text) Schleife durchläuft das Textfeld.
  c = Mid(txtTextfeld.Text, n, 1) Sucht einzelne Buchstaben.
   Select Case c
    Case "ä", "Ä"
      AnzahlÄ = AnzahlÄ + 1
    Case "ö", "Ö"
      AnzahlÖ = AnzahlÖ + 1
    Case "ü", "Ü"
      AnzahlÜ = AnzahlÜ + 1
   End Select
 Next
lblAnzahlÄ.Caption = Format(AnzahlÄ, "0") Ausgabe im Label.
lblAnzahlÖ.Caption = Format(AnzahlÖ, "0")
lblAnzahlÜ.Caption = Format(AnzahlÜ, "0")
End Sub
.
.

 Ranking-Hits zurück Sitemap
Designed by www.wbrnet.info