Soru Userform textbox larda büyük harf türkçe karakter sorunu

vuranoğlu

Altın Üye
Katılım
18 Nisan 2008
Mesajlar
252
Excel Vers. ve Dili
excel 2016 tr
Altın Üyelik Bitiş Tarihi
22.01.2026
Private Sub TextBox4_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)

KeyAscii = Asc(UCase(Chr(KeyAscii)))
TextBox4 = Replace(TextBox4, "i", "İ")
TextBox4 = Replace(TextBox4, "ı", "I")
TextBox4 = Replace(TextBox4, "ğ", "Ğ")
TextBox4 = Replace(TextBox4, "ç", "Ç")
TextBox4 = Replace(TextBox4, "ş", "Ş")
TextBox4 = Replace(TextBox4, "ö", "Ö")
TextBox4 = Replace(TextBox4, "ü", "Ü")

If TextBox4 = vbNullString Then Exit Sub
If IsNumeric(TextBox4) Then
MsgBox "SADECE HARF GİREBİLİRSİNİZ.", vbExclamation, " DİKKAT !"
TextBox4 = vbNullString
End If
TextBox4.BackColor = 14020607

'TextBox3.Text = ""
End Sub

Merhaba
Bu kodlarla büyük harf girişini sağlıyorum,
ancak türkçe karakterler de hataya düşüyor.
Sorunu nasıl çözebiliriz?
Teşekkürler.
 

Ekli dosyalar

Katılım
15 Aralık 2017
Mesajlar
103
Excel Vers. ve Dili
Microsoft Office Ev ve İş 2013 - 32 bit
Altın Üyelik Bitiş Tarihi
21/12/2022
Private Sub TextBox4_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
Dim newText As String
newText = TextBox4.Text

KeyAscii = Asc(UCase(Chr(KeyAscii)))
newText = Replace(newText, "i", "İ")
newText = Replace(newText, "ı", "I")
newText = Replace(newText, "ğ", "Ğ")
newText = Replace(newText, "ç", "Ç")
newText = Replace(newText, "ş", "Ş")
newText = Replace(newText, "ö", "Ö")
newText = Replace(newText, "ü", "Ü")

If newText = vbNullString Then Exit Sub
If IsNumeric(newText) Then
MsgBox "SADECE HARF GİREBİLİRSİNİZ.", vbExclamation, " DİKKAT !"
TextBox4.Text = vbNullString
Exit Sub
End If

TextBox4.Text = newText
TextBox4.SelStart = Len(TextBox4.Text)
TextBox4.BackColor = 14020607

'TextBox3.Text = ""
End Sub


deneyiniz
 

vuranoğlu

Altın Üye
Katılım
18 Nisan 2008
Mesajlar
252
Excel Vers. ve Dili
excel 2016 tr
Altın Üyelik Bitiş Tarihi
22.01.2026
Merhaba
Hata veriyor.
 

Ekli dosyalar

Katılım
20 Kasım 2022
Mesajlar
10
Excel Vers. ve Dili
Office 365
Bunu dener misiniz.


Kod:
[CODE]

Private Sub TextBox4_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)



KeyAscii = Asc(UCase(Chr(KeyAscii)))

TextBox4 = Replace(TextBox4, ChrW(105), ChrW(304)) 'i -> İ

TextBox4 = Replace(TextBox4, ChrW(305), ChrW(73)) 'ı -> I

TextBox4 = Replace(TextBox4, ChrW(287), ChrW(286)) 'ğ -> Ğ

TextBox4 = Replace(TextBox4, ChrW(231), ChrW(199)) 'ç -> Ç

TextBox4 = Replace(TextBox4, ChrW(351), ChrW(350)) 'ş -> Ş

TextBox4 = Replace(TextBox4, ChrW(246), ChrW(214)) 'ö -> Ö

TextBox4 = Replace(TextBox4, ChrW(252), ChrW(220)) 'ü -> Ü



If TextBox4 = vbNullString Then Exit Sub

If IsNumeric(TextBox4) Then

MsgBox "SADECE HARF GİREBİLİRSİNİZ.", vbExclamation, " DİKKAT !"

TextBox4 = vbNullString

End If

TextBox4.BackColor = 14020607



'TextBox3.Text = ""

End Sub
[/CODE]
 

vuranoğlu

Altın Üye
Katılım
18 Nisan 2008
Mesajlar
252
Excel Vers. ve Dili
excel 2016 tr
Altın Üyelik Bitiş Tarihi
22.01.2026
Merhaba
Aynı hatayı veriyor.
 

Ekli dosyalar

Üst