- Katılım
- 5 Ocak 2009
- Mesajlar
- 1,586
- Excel Vers. ve Dili
- 2003 Türkçe
Selam Arkadaşlar,
Aşağıdaki kodlar ile TextBox'a metin girişlerini engelliyorum. Ancak, TextBox9'a bir türlü SetFocus yapamıyorum. Neden yapamıyorum? Yardımcı olabilir misiniz?
Aşağıdaki kodlar ile TextBox'a metin girişlerini engelliyorum. Ancak, TextBox9'a bir türlü SetFocus yapamıyorum. Neden yapamıyorum? Yardımcı olabilir misiniz?
Kod:
Private Sub TextBox9_Change()
If Me.TextBox9 <> "" Then
If Not IsNumeric(Me.TextBox9) Then
MsgBox "sayısal değer giriniz"
For i = 1 To Len(Me.TextBox9)
kr = Mid(Me.TextBox9, i, 1)
If Not IsNumeric(kr) Then
Me.TextBox9.SelStart = 0
Me.TextBox9.SelLength = i - 1
sol = Me.TextBox9.SelText
Me.TextBox9.SelStart = i
Me.TextBox9.SelLength = Len(Me.TextBox9) - i
sag = Me.TextBox9.SelText
End If
Next
Me.TextBox9 = sol & sag
Me.TextBox9.SetFocus
End If
End If
End Sub