• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

Çoklu Textbox kontrol

musculus2

Altın Üye
Altın Üye
Katılım
23 Şubat 2007
Mesajlar
112
Excel Vers. ve Dili
2010 türkçe
Userformumda 18 adet Textbox var.
Textbox18 de tarih yazıyor.
Textbox2 de zorunlu sayısal değer var.
Textbox 3-17 arası ise ya boş olacak ya da sayısal değer olacak.

If TextBox1.Value = "" Then
MsgBox "Cash değerini boş giremezsiniz ?", , "Boş değer"
Exit Sub
End If

If (IsNumeric(TextBox2) And IsNumeric(TextBox3) And IsNumeric(TextBox4) And IsNumeric(TextBox5) And IsNumeric(TextBox6) And IsNumeric(TextBox7) And IsNumeric(TextBox8) And IsNumeric(TextBox9) And IsNumeric(TextBox10) And IsNumeric(TextBox11) And IsNumeric(TextBox12) And IsNumeric(TextBox13) And IsNumeric(TextBox14) And IsNumeric(TextBox15) And IsNumeric(TextBox16) And IsNumeric(TextBox17)) Then GoTo 20


MsgBox "sayısal değer giriniz"

20

Bu şekilde sorunumu çözemedim.Boş değerleride sayısal değer girin diye uyarı veriyor.
 
Herbir textbox için bu şekilde yaptım sorunum çözüldü.Teşekkür ederim :)

If TextBox3.Value = "" Then GoTo 30
If IsNumeric(TextBox3) Then GoTo 30
MsgBox "çalışan için sayısal değer giriniz"
TextBox3.Value = ""
TextBox3.SetFocus
Exit Sub
30

If TextBox4.Value = "" Then GoTo 40
If IsNumeric(TextBox4) Then GoTo 40
MsgBox "çalışan için sayısal değer giriniz"
TextBox4.Value = ""
TextBox4.SetFocus
Exit Sub
40
 
İlk formül aşağıdaki gibi devam etmeliydi:
If (IsNumeric(TextBox2) And (IsNumeric(TextBox3) Or TextBox3.value="") And (IsNumeric(TextBox4) Or TextBox4.value="") .....
 
:)
Evet mantık hatası yapmışım.
 
Geri
Üst