Textboxlar dolu ise Commandbutton çalışsın

Katılım
12 Mayıs 2006
Mesajlar
455
Arkadaşlar eğer Textbox1 ve textbox2 dolu ise yani içine veri girilmişse CommandButton4 çalışsın yoksa çalışmasın veya pasif görünsün. Nasıl bir kod nereye yazmamız lazım.
 
Katılım
13 Aralık 2007
Mesajlar
93
Excel Vers. ve Dili
excel 2003
merhaba..aşağıdaki kod işiize yararmı.

form ınitalize ye veya textbox1 change ye

CommandButton1.Locked = True

Private Sub TextBox2_Change()
If TextBox1.Value > "" Then
If TextBox2.Value > "" Then
CommandButton1.Locked = False
End If
End If
End Sub
 
Katılım
21 Ağustos 2005
Mesajlar
625
Excel Vers. ve Dili
Office 365 - İngilizce
Kodlar aşağıdaki gibi olmalı.

Kod:
If TextBox1.Value = Empty And TextBox2.Value = Empty Then
CommandButton4.Enabled = False
Else
CommandButton4.Enabled = True
End If
 
Üst