• DİKKAT

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

Checbox ile Toplam Alma

Katılım
7 Ekim 2013
Mesajlar
66
Excel Vers. ve Dili
türkçe
Arkadaşlar merhaba;
Ekte örnek dosyayı paylaştım.
Yapmak istediğim Checkboxlardan işaretli olanların tutarlarının en alttaki Toplam Tutar kısmında toplanması.Ayrıca kutucuklarda yazan rakamların virgülden sonra 2 hane kalacak biçimde TL olarak gösterilmesi.
Yardım ederseniz sevinirim.
 
Dosyanızı herhangi bir dosya paylaşım sitesine yükleyerek link verebilirsiniz.
 
Userformun içindeki bütün kodları silin ve aşağıdaki kodları ekleyiniz.

kod:

Kod:
Private Sub CheckBox1_Click()
toplam_Click
End Sub
Private Sub CheckBox2_Click()
toplam_Click
End Sub
Private Sub CheckBox3_Click()
toplam_Click
End Sub
Private Sub CheckBox4_Click()
toplam_Click
End Sub

Private Sub CheckBox5_Click()
toplam_Click
End Sub
Private Sub CheckBox6_Click()
If CheckBox6.Value = True Then
TextBox7.Value = 118
TextBox19.Value = TextBox7.Value
TextBox13.Text = "YOK"
CheckBox7.Value = False

End If
toplam_Click
End Sub

Private Sub CheckBox7_Click()
If CheckBox7.Value = True Then
TextBox7.Value = 236
TextBox19.Value = TextBox7.Value
TextBox13.Text = "YOK"
CheckBox6.Value = False
End If
toplam_Click
End Sub

Private Sub TextBox1_Change()

deg1 = Val(TextBox1) * 0.005
deg2 = Val(TextBox3) * 0.05
deg3 = Val(TextBox3) + Val(TextBox9)
deg4 = Val(TextBox1) * 0.005
deg5 = Val(TextBox4) * 0.05
deg6 = Val(TextBox4) + Val(TextBox10)
deg7 = Val(TextBox1) * 0.005
deg8 = Val(TextBox5) * 0.05
deg9 = Val(TextBox5) + Val(TextBox11)
deg10 = 57.75
deg11 = TextBox6.Value
deg12 = "YOK"
deg13 = 250
deg14 = 12.5
deg15 = 262.5


TextBox3 = Round(Replace(TextBox1.Text * 0.005, ".", ","), 2) * 1
TextBox9 = Round(Replace(deg1 * 0.05, ".", ","), 2) * 1
TextBox15 = Round(Replace(deg1 + deg2, ".", ","), 2) * 1

TextBox4 = Round(Replace(TextBox1.Text * 0.005, ".", ","), 2) * 1
TextBox10 = Round(Replace(deg4 * 0.05, ".", ","), 2) * 1
TextBox16 = Round(Replace(deg4 + deg5, ".", ","), 2) * 1
TextBox5 = Round(Replace(TextBox1.Text * 0.005, ".", ","), 2) * 1
TextBox11 = Round(Replace(deg7 * 0.05, ".", ","), 2) * 1
TextBox17 = Round(Replace(deg7 + deg8, ".", ","), 2) * 1

TextBox6.Value = Round(Replace(57.75, ".", ","), 2) * 1
TextBox18.Value = Round(Replace(deg10, ".", ","), 2) * 1

TextBox12.Text = "YOK"
TextBox2.Value = Round(Replace(250, ".", ","), 2) * 1
TextBox8.Value = Round(Replace(12.5, ".", ","), 2) * 1
TextBox14.Value = Round(Replace(262.5, ".", ","), 2) * 1

toplam_Click
End Sub
Private Sub toplam_Click()


deg = 0
For i = 1 To 6
If i = 6 Then
If Controls("CheckBox" & i).Value = True Or Controls("CheckBox" & i + 1).Value = True Then
sayi = Replace(Controls("TextBox" & i + 13).Text, ".", ",")
deg = deg + Round(sayi, 2) * 1
End If
Else
If Controls("CheckBox" & i).Value = True Then
sayi = Replace(Controls("TextBox" & i + 13).Text, ".", ",")
deg = deg + Round(sayi, 2) * 1
End If
End If


Next i
TextBox20.Text = deg

For j = 2 To 20
If Right(Controls("TextBox" & j).Text, 2) <> "TL" Then
If IsNumeric(Mid(Controls("TextBox" & j).Text, 1, 1)) = True Then
Controls("TextBox" & j).Text = Controls("TextBox" & j).Text & " TL"
End If
End If
Next j


End Sub
 
halit hocam harikasınız.elinize sağlık.kodlar süper çalışıyor.değerli vaktinizi ayırdınız çok teşekkür ederim.
 
hocam kusura bakmayın.en altta AZG kısmı var.bunun 2 çeşidi var.biri 118 TL diğeri 236 TL.Hangisi seçilirse onunda toplamını alması gerekiyor.fakat bunu toplama dahil etmiyor.haricinde 1 yıllık seçiliyken 2 yıllıkta aynı anda seçilebiliyor.fakat sadece birinin seçili kalması gerekiyor.hangisi seçildiyse onu da toplama dahil etmiyor hocam.
 
hocam kusura bakmayın.en altta AZG kısmı var.bunun 2 çeşidi var.biri 118 TL diğeri 236 TL.Hangisi seçilirse onunda toplamını alması gerekiyor.fakat bunu toplama dahil etmiyor.haricinde 1 yıllık seçiliyken 2 yıllıkta aynı anda seçilebiliyor.fakat sadece birinin seçili kalması gerekiyor.hangisi seçildiyse onu da toplama dahil etmiyor hocam.

7 nolu mesajı güncelledim
 
elinize sağlık.saygılarımı sunuyorum hocam.10 numara çalışıyor.
peki arkadaşlar masraflar artık otomatikman hesaplanıyor.fakat bazı masraf kalemlerinin belli bir üst sınırı var.ya da alt sınırı.textbox içinde otomatik gelen masraf tutarını minimum ve maksimum olarak nasıl sınırlandırabilirim?
örneğin kdm değerleme masraf kaleminden minimum 50 TL maksimum 250 TL alınsın.
 
http://speedy.sh/dtKH4/Book1.xlsm

hocam yukarıda dosyamın son halini paylaştım.bundan sonra herhangi bir değişiklik olmayacak.şimdiye kadar olan yardımlarınız için teşekkür ederim.hepsi işe yaradı.
önceki mesajımda maksimum ve minimum değerleri sormuştum.bunu uygulayabilir miyiz?ben kredi tutarı kısmına 90.000 TL tutarını yazdığımda otomatikman aşağıda hesaplamaları yapsın.fakat limit tahsis kaleminde asıl masraf sütununda tutar minimum ve maksimum 250 TL olsun her durumda.Kar düzenleme kaleminde asıl masraf sütununda ise minimum 50 TL maksimum 250 TL olsun.Ekspertiz minimum 50 TL maksimum 500 TL ve ipotek tesis de minimum 50 TL maksimum 500 TL olsun.
Ayrıca en üstte kredi tutarı kısmına tutarı yazdığımda TL olarak ve her 3 rakamda bir alttakiler gibi nokta koyarak ayırmıyor.
2 tane daha masraf kalemi ekledim.bunlar kasko ve komisyon.bu iki kutucuğa manuel giriş yapabileyim.ve yine üstteki format gibi her 3 rakamda noktalama işareti ile ayırsın ve TL cinsini belirtsin.yanlarındaki checkbox'ı işaretlediğimde de toplama dahil etsin.
Herşeyi sen yaptın hocam ben de YAZDIR komutunu uygulayabilirim :)
Saygı ve hürmetlerimle.
 
elinize sağlık.saygılarımı sunuyorum hocam.10 numara çalışıyor.
peki arkadaşlar masraflar artık otomatikman hesaplanıyor.fakat bazı masraf kalemlerinin belli bir üst sınırı var.ya da alt sınırı.textbox içinde otomatik gelen masraf tutarını minimum ve maksimum olarak nasıl sınırlandırabilirim?
örneğin kdm değerleme masraf kaleminden minimum 50 TL maksimum 250 TL alınsın.

O zaman kodları tek tek yeniden yazmak gerekir buda hayli bir zahmetli

1 nolu mesajındaki soruna dönük yazıldı bu kodlar.
 
tamamdır hocam.gerisini inceleyeyim ben.bu kadar zahmet verdim.tekrar tekrar teşekkür ederim.hürmetler hocam.
 
http://speedy.sh/dtKH4/Book1.xlsm

hocam yukarıda dosyamın son halini paylaştım.bundan sonra herhangi bir değişiklik olmayacak.şimdiye kadar olan yardımlarınız için teşekkür ederim.hepsi işe yaradı.
önceki mesajımda maksimum ve minimum değerleri sormuştum.bunu uygulayabilir miyiz?ben kredi tutarı kısmına 90.000 TL tutarını yazdığımda otomatikman aşağıda hesaplamaları yapsın.fakat limit tahsis kaleminde asıl masraf sütununda tutar minimum ve maksimum 250 TL olsun her durumda.Kar düzenleme kaleminde asıl masraf sütununda ise minimum 50 TL maksimum 250 TL olsun.Ekspertiz minimum 50 TL maksimum 500 TL ve ipotek tesis de minimum 50 TL maksimum 500 TL olsun.
Ayrıca en üstte kredi tutarı kısmına tutarı yazdığımda TL olarak ve her 3 rakamda bir alttakiler gibi nokta koyarak ayırmıyor.
2 tane daha masraf kalemi ekledim.bunlar kasko ve komisyon.bu iki kutucuğa manuel giriş yapabileyim.ve yine üstteki format gibi her 3 rakamda noktalama işareti ile ayırsın ve TL cinsini belirtsin.yanlarındaki checkbox'ı işaretlediğimde de toplama dahil etsin.
Herşeyi sen yaptın hocam ben de YAZDIR komutunu uygulayabilirim :)
Saygı ve hürmetlerimle.

kod:

Kod:
Private Sub CheckBox1_Click()
toplam_Click
End Sub
Private Sub CheckBox2_Click()
toplam_Click
End Sub
Private Sub CheckBox3_Click()
toplam_Click
End Sub
Private Sub CheckBox4_Click()
toplam_Click
End Sub

Private Sub CheckBox5_Click()
toplam_Click
End Sub
Private Sub CheckBox6_Click()
If CheckBox6.Value = True Then
TextBox7.Value = 118
TextBox19.Value = TextBox7.Value
TextBox13.Text = "YOK"
CheckBox7.Value = False

End If
toplam_Click
End Sub

Private Sub CheckBox7_Click()
If CheckBox7.Value = True Then
TextBox7.Value = 236
TextBox19.Value = TextBox7.Value
TextBox13.Text = "YOK"
CheckBox6.Value = False
End If
toplam_Click
End Sub

Private Sub CheckBox8_Click()
toplam_Click

End Sub

Private Sub CheckBox9_Click()
toplam_Click
End Sub


Private Sub TextBox1_Change()
If TextBox1.Text = "" Then Exit Sub
say1 = 0.005
say2 = 0.05
say3 = 57.75
say4 = 250
say5 = 12.5
say6 = 262.5
say7 = "YOK"


deg1 = Val(TextBox1) * say1
deg2 = Val(TextBox3) * say2
deg3 = Val(TextBox3) + Val(TextBox9)
deg4 = Val(TextBox1) * say1
deg5 = Val(TextBox4) * say2
deg6 = Val(TextBox4) + Val(TextBox10)
deg7 = Val(TextBox1) * say1
deg8 = Val(TextBox5) * say2
deg9 = Val(TextBox5) + Val(TextBox11)
deg10 = TextBox6.Value



TextBox3 = Round(Replace(TextBox1.Text * say1, ".", ","), 2) * 1
If TextBox1.Text * say1 <= 50 Then TextBox3.Value = 50
If TextBox1.Text * say1 >= 250 Then TextBox3.Value = 250

TextBox9 = Round(Replace(deg1 * say2, ".", ","), 2) * 1
TextBox15 = Round(Replace(deg1 + deg2, ".", ","), 2) * 1

TextBox4 = Round(Replace(TextBox1.Text * say1, ".", ","), 2) * 1
If TextBox1.Text * say1 <= 50 Then TextBox4.Value = 50
If TextBox1.Text * say1 >= 500 Then TextBox4.Value = 500



TextBox10 = Round(Replace(deg4 * say2, ".", ","), 2) * 1
TextBox16 = Round(Replace(deg4 + deg5, ".", ","), 2) * 1

TextBox5 = Round(Replace(TextBox1.Text * say1, ".", ","), 2) * 1
If TextBox1.Text * say1 <= 50 Then TextBox5.Value = 50
If TextBox1.Text * say1 >= 500 Then TextBox5.Value = 500


TextBox11 = Round(Replace(deg7 * say2, ".", ","), 2) * 1
TextBox17 = Round(Replace(deg7 + deg8, ".", ","), 2) * 1

TextBox6.Value = Round(Replace(say3, ".", ","), 2) * 1
TextBox18.Value = Round(Replace(say3, ".", ","), 2) * 1

TextBox12.Text = say7


TextBox2.Value = Round(Replace(say4, ".", ","), 2) * 1


TextBox8.Value = Round(Replace(say5, ".", ","), 2) * 1
TextBox14.Value = Round(Replace(say6, ".", ","), 2) * 1

toplam_Click



End Sub
Private Sub toplam_Click()


deg = 0
For i = 1 To 6
If i = 6 Then
If Controls("CheckBox" & i).Value = True Or Controls("CheckBox" & i + 1).Value = True Then
sayi = Replace(Controls("TextBox" & i + 13).Text, ".", ",")
deg = deg + Round(sayi, 2) * 1
End If
Else
If Controls("CheckBox" & i).Value = True Then
sayi = Replace(Controls("TextBox" & i + 13).Text, ".", ",")
deg = deg + Round(sayi, 2) * 1
End If
End If
Next i

deg2 = 0: de3 = 0
If CheckBox8.Value = True Then
If TextBox21 <> "" Then
deg2 = Round(Replace(TextBox21.Text, ".", ","), 2) * 1
End If
Else
deg2 = 0
End If

If CheckBox9.Value = True Then
If TextBox22 <> "" Then
deg3 = Round(Replace(TextBox22.Text, ".", ","), 2) * 1
End If
Else
deg3 = 0
End If



TextBox20.Text = deg + deg2 + deg3

For j = 2 To 20
If Right(Controls("TextBox" & j).Text, 2) <> "TL" Then
If IsNumeric(Mid(Controls("TextBox" & j).Text, 1, 1)) = True Then
Controls("TextBox" & j).Text = Controls("TextBox" & j).Text & " TL"
End If
End If
Next j


If CheckBox8.Value = True Then
If Right(TextBox21.Text, 2) <> "TL" Then
If IsNumeric(Mid(TextBox21.Text, 1, 1)) = True Then
TextBox21.Text = TextBox21.Text & " TL"
End If
End If
End If

If CheckBox9.Value = True Then
If Right(TextBox22.Text, 2) <> "TL" Then
If IsNumeric(Mid(TextBox22.Text, 1, 1)) = True Then
TextBox22.Text = TextBox22.Text & " TL"
End If
End If
End If

End Sub


Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)

deg20 = Round(Replace(TextBox1.Text, ".", ","), 2) * 1

TextBox1.Text = Format(deg20, "###,###.00")

If Right(TextBox1.Text, 2) <> "TL" Then
If IsNumeric(Mid(TextBox1.Text, 1, 1)) = True Then
TextBox1.Text = TextBox1.Text & " TL"
End If
End If

End Sub

Private Sub TextBox21_Exit(ByVal Cancel As MSForms.ReturnBoolean)
CheckBox8.Value = False
toplam_Click
End Sub

Private Sub TextBox22_Exit(ByVal Cancel As MSForms.ReturnBoolean)
CheckBox9.Value = False
toplam_Click
End Sub
 
Geri
Üst