Code Menset Isi Text Box Menjadi Sentence Case
Option Explicit
Dim KP As Boolean
Dim SpaceBar As String
Dim strResult, strTemp As String
Private Sub KeyPress(KeyAscii As Integer)
On Error Resume NextIf Len(Text1) = 1 Then
strResult = Text1
If KeyAscii = 32 Then
End Sub
Dim KP As Boolean
Dim SpaceBar As String
Dim strResult, strTemp As String
Private Sub KeyPress(KeyAscii As Integer)
On Error Resume NextIf Len(Text1) = 1 Then
strResult = Text1End If
strResult = UCase$(Left$(strResult, 1)) & Mid$(strResult, 2)
Text1 = strResult
Text1.SelStart = Len(strResult) + 1
ElseIf SpaceBar = "Y" Then
strTemp = UCase$(Right$(Text1, 1))
Text1 = strResult & strTemp
Text1.SelStart = Len(strResult) + 1
SpaceBar = ""
strResult = Text1
If KeyAscii = 32 Then
KP = TrueElseIf KP = True Then
SpaceBar = "Y"End If
KP = False
End Sub