• DİKKAT

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

Textbox'a otomatik hesap yaptırma

sukruyilmaz1

Altın Üye
Katılım
19 Haziran 2008
Mesajlar
301
Excel Vers. ve Dili
Office 365
Merhabalar Sayın Üstadlarım.

Ekteki örnekteki userform üzerinde, Malzeme adedi ile Malzeme birim fiyatını yazdığımda, o anda toplam tutarın hesaplanıp textbox a yazmasını istiyorum. Yani Kaydet butonuna basmadan ben yazınca o anda hesaplamasını ve textbox içine yazılmasını istiyorum.

Yardımlarınız için şimdiden çok teşekkür ederim.
Saygılarımla.
 

Ekli dosyalar

Merhaba.


Aşağıdaki kodları ilave edin.

Kod:
Private Sub TextBox6_Change()
Topla
End Sub

Private Sub TextBox8_Change()
Topla
End Sub

Sub Topla()
    If IsNumeric(TextBox6.Text) And IsNumeric(TextBox8.Text) Then
        TextBox7.Text = TextBox6.Text * TextBox8.Text
    Else
        TextBox7.Text = ""
    End If
End Sub
 
Merhabalar Sayın Üstadlarım.

Ekteki örnekteki userform üzerinde, Malzeme adedi ile Malzeme birim fiyatını yazdığımda, o anda toplam tutarın hesaplanıp textbox a yazmasını istiyorum. Yani Kaydet butonuna basmadan ben yazınca o anda hesaplamasını ve textbox içine yazılmasını istiyorum.

Yardımlarınız için şimdiden çok teşekkür ederim.
Saygılarımla.
Ekli dosyayı deneyiniz.:cool:

Kod:
Private Sub TextBox8_Change()
Dim adet As Double, fiyat As Double
If IsNumeric(TextBox8.Value) Then adet = TextBox8.Value
If IsNumeric(TextBox6.Value) Then fiyat = TextBox6.Value
TextBox7.Value = Format(adet * fiyat, "#,##0.00")
End Sub

Kod:
Private Sub TextBox6_Change()
Dim adet As Double, fiyat As Double
If IsNumeric(TextBox8.Value) Then adet = TextBox8.Value
If IsNumeric(TextBox6.Value) Then fiyat = TextBox6.Value
TextBox7.Value = Format(adet * fiyat, "#,##0.00")
End Sub
 

Ekli dosyalar

Merhaba.


Aşağıdaki kodları ilave edin.

Kod:
Private Sub TextBox6_Change()
Topla
End Sub

Private Sub TextBox8_Change()
Topla
End Sub

Sub Topla()
    If IsNumeric(TextBox6.Text) And IsNumeric(TextBox8.Text) Then
        TextBox7.Text = TextBox6.Text * TextBox8.Text
    Else
        TextBox7.Text = ""
    End If
End Sub
ÇOK TEŞEKKÜR EDERİM
 
Ekli dosyayı deneyiniz.:cool:

Kod:
Private Sub TextBox8_Change()
Dim adet As Double, fiyat As Double
If IsNumeric(TextBox8.Value) Then adet = TextBox8.Value
If IsNumeric(TextBox6.Value) Then fiyat = TextBox6.Value
TextBox7.Value = Format(adet * fiyat, "#,##0.00")
End Sub

Kod:
Private Sub TextBox6_Change()
Dim adet As Double, fiyat As Double
If IsNumeric(TextBox8.Value) Then adet = TextBox8.Value
If IsNumeric(TextBox6.Value) Then fiyat = TextBox6.Value
TextBox7.Value = Format(adet * fiyat, "#,##0.00")
End Sub
Emeğinize sağlık Sayın Orion1 Üstadım. Peki bu değerlere "TL" simgesi koyabilir miyiz?
 
Emeğinize sağlık Sayın Orion1 Üstadım. Peki bu değerlere "TL" simgesi koyabilir miyiz?
Buyurun.:cool:
Kod:
Private Sub TextBox6_Change()
Dim adet As Double, fiyat As Double
If IsNumeric(TextBox8.Value) Then adet = TextBox8.Value
If IsNumeric(TextBox6.Value) Then fiyat = TextBox6.Value
TextBox7.Value = VBA.FormatCurrency(adet * fiyat, 2)
End Sub
Kod:
Private Sub TextBox8_Change()
Dim adet As Double, fiyat As Double
If IsNumeric(TextBox8.Value) Then adet = TextBox8.Value
If IsNumeric(TextBox6.Value) Then fiyat = TextBox6.Value
TextBox7.Value = VBA.FormatCurrency(adet * fiyat, 2)
End Sub
 
Buyurun.:cool:
Kod:
Private Sub TextBox6_Change()
Dim adet As Double, fiyat As Double
If IsNumeric(TextBox8.Value) Then adet = TextBox8.Value
If IsNumeric(TextBox6.Value) Then fiyat = TextBox6.Value
TextBox7.Value = VBA.FormatCurrency(adet * fiyat, 2)
End Sub
Kod:
Private Sub TextBox8_Change()
Dim adet As Double, fiyat As Double
If IsNumeric(TextBox8.Value) Then adet = TextBox8.Value
If IsNumeric(TextBox6.Value) Then fiyat = TextBox6.Value
TextBox7.Value = VBA.FormatCurrency(adet * fiyat, 2)
End Sub
Çok Teşekkür Ederim Sayın Orion, Kusura bakmayın size zahmet Malzeme birim fiyatına da TL Simgesi koymak istiyorum :)
 
Textbox6nın change olayına değilde afterupdate olayına yazılabilir.
Textbox6 dan çıkınca olay oluşuyor.
Kod:
Private Sub TextBox6_AfterUpdate()
TextBox6.Value = VBA.FormatCurrency(TextBox6.Value, 2)
End Sub
 
Textbox6nın change olayına değilde afterupdate olayına yazılabilir.
Textbox6 dan çıkınca olay oluşuyor.
Kod:
Private Sub TextBox6_AfterUpdate()
TextBox6.Value = VBA.FormatCurrency(TextBox6.Value, 2)
End Sub
Çok teşekkür ederim Sayın Orion1...Halloldu.
 
Rica ederim.
İyi çalışmalar.:cool:
 
Geri
Üst