• DİKKAT

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

Modül hakkında

zulfuernek

Altın Üye
Katılım
24 Haziran 2017
Mesajlar
761
Excel Vers. ve Dili
türkçe
aşağıdaki formülü yaklaşık olarak 40 tane textboxun içerisine uyguluyorum.

bunun yerine modüle nasıl entegre ederim ve textboxların işlem anında modülden bu formülü uygulamasını sağlarım.

textbox 1 e para tutarı yazıyorum ve textboxa yazdığım anda aktif olarak sonuçları labele yazıyor. işlemin kısa tanımı bu şekilde.

KODLAR:

Label51.Caption = Val(TextBox1.Value) * Val(Label9.Caption) * 1000 + _
Val(TextBox2.Value) * Val(Label10.Caption) * 1000 + _
Val(TextBox3.Value) * Val(Label11.Caption) * 1000 + _
Val(TextBox4.Value) * Val(Label12.Caption) * 1000 + _
Val(TextBox5.Value) * Val(Label13.Caption) * 1000 + _
Val(TextBox6.Value) * Val(Label14.Caption) * 1000 + _
Val(TextBox7.Value) * Val(Label15.Caption) * 1000
Label51 = Format(Label51, "###,###.00" & " TL")
Label81 = Label51
Label81 = Format(Label81, "###,###.00" & " TL")
Label86.Caption = Val(TextBox1.Value) * Val(Label9.Caption) * 1000 + _
Val(TextBox2.Value) * Val(Label10.Caption) * 1000 + _
Val(TextBox3.Value) * Val(Label11.Caption) * 1000 + _
Val(TextBox4.Value) * Val(Label12.Caption) * 1000 + _
Val(TextBox5.Value) * Val(Label13.Caption) * 1000 + _
Val(TextBox6.Value) * Val(Label14.Caption) * 1000 + _
Val(TextBox7.Value) * Val(Label15.Caption) * 1000 + _
Val(TextBox8.Value) * Val(Label16.Caption) * 100 + _
Val(TextBox9.Value) * Val(Label17.Caption) * 100 + _
Val(TextBox10.Value) * Val(Label18.Caption) * 100 + _
Val(TextBox11.Value) * Val(Label19.Caption) * 100 + _
Val(TextBox12.Value) * Val(Label20.Caption) * 100 + _
Val(TextBox13.Value) * Val(Label21.Caption) * 100 + _
Val(TextBox14.Value) * Val(Label22.Caption) * 100 + _
Val(TextBox15.Value) * Val(Label23.Caption) + _
Val(TextBox16.Value) * Val(Label24.Caption) + _
Val(TextBox17.Value) * Val(Label25.Caption) + _
Val(TextBox18.Value) * Val(Label26.Caption) + _
Val(TextBox19.Value) * Val(Label27.Caption) + _
Val(TextBox20.Value) * Val(Label28.Caption) + _
Val(TextBox21.Value) * Val(Label29.Caption)
Label86 = Format(Label86, "###,###.00" & " TL")
Label87 = Label86
Label87 = Format(Label87, "###,###.00" & " TL")
 
modüller hakkında henüz bir bilgim yok arkadaşlar. bunuda öğrenecem inşallah sizlerin cevaplarıyla.
 
Boş bir modüle aşağıdaki kodu uygulayın.

UserForm adını kendinize göre değiştirirsiniz.

Kod:
Sub Hesapla()
    With [COLOR="Red"]UserForm1[/COLOR]
        .Label51.Caption = Val(.TextBox1.Value) * Val(.Label9.Caption) * 1000 + _
        Val(.TextBox2.Value) * Val(.Label10.Caption) * 1000 + _
        Val(.TextBox3.Value) * Val(.Label11.Caption) * 1000 + _
        Val(.TextBox4.Value) * Val(.Label12.Caption) * 1000 + _
        Val(.TextBox5.Value) * Val(.Label13.Caption) * 1000 + _
        Val(.TextBox6.Value) * Val(.Label14.Caption) * 1000 + _
        Val(.TextBox7.Value) * Val(.Label15.Caption) * 1000
        .Label51 = Format(.Label51, "###,###.00" & " TL")
        .Label81 = .Label51
        .Label81 = Format(.Label81, "###,###.00" & " TL")
        .Label86.Caption = Val(.TextBox1.Value) * Val(.Label9.Caption) * 1000 + _
        Val(.TextBox2.Value) * Val(.Label10.Caption) * 1000 + _
        Val(.TextBox3.Value) * Val(.Label11.Caption) * 1000 + _
        Val(.TextBox4.Value) * Val(.Label12.Caption) * 1000 + _
        Val(.TextBox5.Value) * Val(.Label13.Caption) * 1000 + _
        Val(.TextBox6.Value) * Val(.Label14.Caption) * 1000 + _
        Val(.TextBox7.Value) * Val(.Label15.Caption) * 1000 + _
        Val(.TextBox8.Value) * Val(.Label16.Caption) * 100 + _
        Val(.TextBox9.Value) * Val(.Label17.Caption) * 100 + _
        Val(.TextBox10.Value) * Val(.Label18.Caption) * 100 + _
        Val(.TextBox11.Value) * Val(.Label19.Caption) * 100 + _
        Val(.TextBox12.Value) * Val(.Label20.Caption) * 100 + _
        Val(.TextBox13.Value) * Val(.Label21.Caption) * 100 + _
        Val(.TextBox14.Value) * Val(.Label22.Caption) * 100 + _
        Val(.TextBox15.Value) * Val(.Label23.Caption) + _
        Val(.TextBox16.Value) * Val(.Label24.Caption) + _
        Val(.TextBox17.Value) * Val(.Label25.Caption) + _
        Val(.TextBox18.Value) * Val(.Label26.Caption) + _
        Val(.TextBox19.Value) * Val(.Label27.Caption) + _
        Val(.TextBox20.Value) * Val(.Label28.Caption) + _
        Val(.TextBox21.Value) * Val(.Label29.Caption)
        .Label86 = Format(.Label86, "###,###.00" & " TL")
        .Label87 = .Label86
        .Label87 = Format(.Label87, "###,###.00" & " TL")
    End With
End Sub


Daha sonra TextBox nesnelerinizin kod bölümüne aşağıdaki gibi uygulayınız.

Kod:
Private Sub TextBox1_Change()
    Call Hesapla
End Sub
 
Geri
Üst