• DİKKAT

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

textbox1'un değer boşken textbox2 değeri silinsin!

Katılım
18 Kasım 2009
Mesajlar
41
Excel Vers. ve Dili
excel 2010
Merhaba
Konu başlığındada belirttiğim gibi textbox1'un değer boşken textbox2 değeri silebilmem için makro kodu verebilirmisiniz?
g2oO2b.jpg


Kod:
Public kontrol As Integer
Private Sub TextBox1_Change()
If Not IsNumeric(TextBox1) Then SendKeys "{BS}" 'sadece rakam ve nokta,virgül girilebilir
If (kontrol = 0) Then
 btc = Val(TextBox1.Value)
 eur = btc * Val(ActiveSheet.Range("W63").Value)
 TextBox2.Text = eur
 TextBox2 = Format(TextBox2, "#,##0.0000")
 
End If
TextBox1.Text = ""
End Sub

Private Sub TextBox1_GotFocus()
TextBox1.Text = "" 'textbox1 boşaltma
kontrol = 0 'kontrol btc de

End Sub

Private Sub TextBox2_Change()
If Not IsNumeric(TextBox2) Then SendKeys "{BS}" 'sadece rakam ve nokta,virgül girilebilir

If (kontrol = 1) Then
 eur = Val(TextBox2.Value)
 btc = eur / Val(ActiveSheet.Range("W63").Value)
 TextBox1.Text = btc
 TextBox1 = Format(TextBox1, "#,##0.0000")

End If

End Sub

Private Sub TextBox2_GotFocus()
TextBox2.Text = "" 'textbox2 boşaltma
kontrol = 1 'kontrol euro da

End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

End Sub
 
Son düzenleme:
Merhaba
Yukarıdaki mesajda bulunan yukarıdan aşağı 3 makrodaki "End sub" ifadesinin üstüne
Kod:
'.....
'.....kodlarınız
'......
 If textbox1 = "" Then textbox2 = ""
End Sub
gibi olabilir.
 
Eyvallah allah razı olsun..
 
Geri
Üst