• DİKKAT

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

Toplama

Katılım
12 Ekim 2021
Mesajlar
91
Excel Vers. ve Dili
Türkçe
Ek'te gönderdiğim UserForm isimli Excel çalışmamda DataInput isimli butona tıkladığımda Userform1 açılıyor. Açılan pencerede Texbox1 ve Texbox2 e veri girdiğimde Label1 e toplamasını istiyorum. Dosyada detaylı açıklamalar mevcuttur. Yardımlarınıza ihtiyacım vardır. Şimdiden teşekkür ederim.
 

Ekli dosyalar

Aşağıdaki kodu ekleyiniz.

Textbox2 ye veri girişi yaptığınızda Label1 de sonucu göreceksiniz.

Kod:
Private Sub TextBox2_Change()
UserForm1.Label1 = CDbl(UserForm1.TextBox1) + CDbl(UserForm1.TextBox2)
End Sub
 
Aşağıdaki kodu ekleyiniz.

Textbox2 ye veri girişi yaptığınızda Label1 de sonucu göreceksiniz.

Kod:
Private Sub TextBox2_Change()
UserForm1.Label1 = CDbl(UserForm1.TextBox1) + CDbl(UserForm1.TextBox2)
End Sub
hocam elinize sağlık çok teşekkür ederim
 
Aşağıdaki kodu ekleyiniz.

Textbox2 ye veri girişi yaptığınızda Label1 de sonucu göreceksiniz.

Kod:
Private Sub TextBox2_Change()
UserForm1.Label1 = CDbl(UserForm1.TextBox1) + CDbl(UserForm1.TextBox2)
End Sub
hocam textbox 1 i boş bırakıyorum textbox2 ye veri girdiğimde hata veriyor
 
Aşağıdaki kodu ekleyiniz.

Textbox2 ye veri girişi yaptığınızda Label1 de sonucu göreceksiniz.

Kod:
Private Sub TextBox2_Change()
UserForm1.Label1 = CDbl(UserForm1.TextBox1) + CDbl(UserForm1.TextBox2)
End Sub
Textbox1 'e veri gridiğim zaman label1'e direk Düşmesini istiyorum Texbox2 ye gelmeden mesala yarımcı olabilir misiniz
 
Aşağıdaki kodları deneyin:

PHP:
Private Sub TextBox1_Change()
If IsNumeric(TextBox1) And IsNumeric(TextBox2) Then
    Label1.Caption = CDbl(TextBox1.Text) + CDbl(TextBox2.Text)
ElseIf IsNumeric(TextBox1) Then
    Label1.Caption = CDbl(TextBox1.Text)
ElseIf IsNumeric(TextBox2) Then
    Label1.Caption = CDbl(TextBox2.Text)
Else
    Label1.Caption = "Sayı giriniz!"
End If
End Sub

Private Sub TextBox2_Change()
If IsNumeric(TextBox1) And IsNumeric(TextBox2) Then
    Label1.Caption = CDbl(TextBox1.Text) + CDbl(TextBox2.Text)
ElseIf IsNumeric(TextBox1) Then
    Label1.Caption = CDbl(TextBox1.Text)
ElseIf IsNumeric(TextBox2) Then
    Label1.Caption = CDbl(TextBox2.Text)
Else
    Label1.Caption = "Sayı giriniz!"
End If
End Sub
 
Aşağıdaki kodları deneyin:

PHP:
Private Sub TextBox1_Change()
If IsNumeric(TextBox1) And IsNumeric(TextBox2) Then
    Label1.Caption = CDbl(TextBox1.Text) + CDbl(TextBox2.Text)
ElseIf IsNumeric(TextBox1) Then
    Label1.Caption = CDbl(TextBox1.Text)
ElseIf IsNumeric(TextBox2) Then
    Label1.Caption = CDbl(TextBox2.Text)
Else
    Label1.Caption = "Sayı giriniz!"
End If
End Sub

Private Sub TextBox2_Change()
If IsNumeric(TextBox1) And IsNumeric(TextBox2) Then
    Label1.Caption = CDbl(TextBox1.Text) + CDbl(TextBox2.Text)
ElseIf IsNumeric(TextBox1) Then
    Label1.Caption = CDbl(TextBox1.Text)
ElseIf IsNumeric(TextBox2) Then
    Label1.Caption = CDbl(TextBox2.Text)
Else
    Label1.Caption = "Sayı giriniz!"
End If
End Sub
Süpersiniz hocam çok teşekkür ederim
 
Geri
Üst