textbox alanına sadece sıfır girilemesin

netvolxxx

Altın Üye
Katılım
29 Ağustos 2023
Mesajlar
181
Excel Vers. ve Dili
2013 Türkçe
Altın Üyelik Bitiş Tarihi
15-04-2027
merhaba userform textbox alanına kullanıcılar sadece sıfır olarak değer girip kaydetmelerini nasıl engellerim bu textbox alanı miktar olduğu için 0 yazmalarını engellemek istiyorum.

şöyle bir kod kullanıyorum bu işlem de bu seferde örnek 10 yazamıyorum.

Private Sub TextBox5_Change()
If TextBox5 = "" Then Exit Sub
If Mid(TextBox5.Value, Len(TextBox5.Value), 1) = "0" Then
MsgBox "MİKTAR SIFIR GİRİLEMEZ"
TextBox5 = ""
End If
end sub
 
Katılım
15 Mart 2005
Mesajlar
387
Excel Vers. ve Dili
Microsoft 2016 En 64 Bit
Altın Üyelik Bitiş Tarihi
20-03-2024
Merhaba,


C++:
Private Sub TextBox5_Change()
    If TextBox5 = "" Then Exit Sub
    If Len(TextBox5.Value) = 1 And TextBox5.Value = 0 Then
        MsgBox "MİKTAR SIFIR GİRİLEMEZ"
        TextBox5 = ""
    End If
End Sub
 

netvolxxx

Altın Üye
Katılım
29 Ağustos 2023
Mesajlar
181
Excel Vers. ve Dili
2013 Türkçe
Altın Üyelik Bitiş Tarihi
15-04-2027
Merhaba,


C++:
Private Sub TextBox5_Change()
    If TextBox5 = "" Then Exit Sub
    If Len(TextBox5.Value) = 1 And TextBox5.Value = 0 Then
        MsgBox "MİKTAR SIFIR GİRİLEMEZ"
        TextBox5 = ""
    End If
End Sub
eyvallah ustad sağolasın teşekkür ederim istediğim buydu....
 
Üst