• DİKKAT

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

TextBox'ın değerine göre CheckBox işaretlensin.

Katılım
12 Ocak 2009
Mesajlar
838
Excel Vers. ve Dili
2003
Merhaba arkadaşlar.
Aşağıdaki kod ile TextBox2 ye zorunlu veri girişi yapılıyor.
Kod:
Private Sub TextBox2_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox1.BackColor = vbWhite
If TextBox2.Value <> 0 And _
       TextBox2.Value <> 5 And _
       TextBox2.Value <> 10 And _
       TextBox2.Value <> 15 And _
       TextBox2.Value <> 35 Then Cancel = True
End Sub
TextBox2 nin aldığı değere göre userformda bulunan CheckBox'lar işaretlenebilirmi.
Örnek:
TextBox2'nin değeri 0 ise CheckBox1 işaretlensin
TextBox2'nin değeri 5 ise CheckBox2 işaretlensin
 
Textboxın içindeki değer her zaman stringtir.Yada text tir.
Ya eşitrin karşılığınada text yazın yada textbox değerini sayıya çevirin.(cdbl() fonksiyonu ip ucu):cool:
Kod:
Private Sub TextBox2_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox1.BackColor = vbWhite
If TextBox2.Value <> "" And _
       TextBox2.Value <> "5" And _
       TextBox2.Value <> "10" And _
       TextBox2.Value <> "15" And _
       TextBox2.Value <> "35" Then Cancel = True
If TextBox2.Text = "0" Then CheckBox1.Value = True
If TextBox2.Text = "5" Then CheckBox2.Value = True
End Sub
 
Teşekkür ederim Evren hocam
 
Geri
Üst