textboxa toplam alma

Katılım
10 Mayıs 2007
Mesajlar
1,395
Excel Vers. ve Dili
2007 Türkçe
merhabalar, her sayfanın e251 hücresindeki değerleri toplayıp textbox1 e alacak bir kod lazım ilgilenen arkadaşlara teşekkür ederim:)

tabiki sonradan sayfa eklenincede bu toplama dahil edecek?
 

Korhan Ayhan

Administrator
Yönetici
Admin
Katılım
15 Mart 2005
Mesajlar
42,680
Excel Vers. ve Dili
Microsoft 365 Tr-En 64 Bit
Selamlar,

Aşağıdaki kodu denermisiniz.

Kod:
Private Sub CommandButton1_Click()
    Dim TOPLAM As Double
    For X = 1 To Sheets.Count
    TOPLAM = TOPLAM + Sheets(X).Range("E251")
    TextBox1 = Format(TOPLAM, "#,##0.00")
    Next
End Sub
 
Katılım
10 Mayıs 2007
Mesajlar
1,395
Excel Vers. ve Dili
2007 Türkçe
bunu butonsuz yapamıyormuyuz sayın korhan bey.çok teşekkür ederim.
 
Katılım
10 Mayıs 2007
Mesajlar
1,395
Excel Vers. ve Dili
2007 Türkçe
tamam userform koduna uyarladım oldu çokj teşekkür edeirm harikasınız:)
 
Katılım
10 Mayıs 2007
Mesajlar
1,395
Excel Vers. ve Dili
2007 Türkçe
Private Sub UserForm_initialize()
Dim syf As Worksheet
ListBox1.ColumnCount = 3
For Each syf In Worksheets
If Left(syf.Name, 1) <> "." Then
ListBox1.AddItem
ListBox1.Column(0, ListBox1.ListCount - 1) = syf.Name
ListBox1.Column(1, ListBox1.ListCount - 1) = syf.Range("f1").Value
ListBox1.Column(2, ListBox1.ListCount - 1) = syf.Range("f2").Value
End If
Next syf

Dim TOPLAM As Double
For X = 1 To Sheets.Count
TOPLAM = TOPLAM + Sheets(X).Range("E251")
TextBox1 = Format(TOPLAM, "#,##0.00")
TOPLAM = TOPLAM + Sheets(X).Range("F251")
TextBox2 = Format(TOPLAM, "#,##0.00")


Next



End Sub

ama bu &#351;ekilde yap&#305;nca borcu alaca&#287;&#305; do&#287;ru getirmiyor:(
 

Ayhan Ercan

Özel Üye
Katılım
10 Ağustos 2005
Mesajlar
1,571
Excel Vers. ve Dili
Microsoft 365- Türkçe
ama bu &#351;ekilde yap&#305;nca borcu alaca&#287;&#305; do&#287;ru getirmiyor:(

Merhaba,

A&#351;a&#287;&#305;daki gibi denermisiniz??

Kod:
Dim [B][COLOR=red]TOPLAM[/COLOR][/B] As Double, [B][COLOR=seagreen]TOPLAMM[/COLOR][/B] As Double
For X = 1 To Sheets.Count
[COLOR=red][B]TOPLAM[/B] [/COLOR]= [COLOR=red][B]TOPLAM[/B][/COLOR] + Sheets(X).Range("E251")
TextBox1 = Format([COLOR=red][B]TOPLAM[/B][/COLOR], "#,##0.00")
[COLOR=seagreen][B]TOPLAMM[/B][/COLOR] = [COLOR=seagreen][B]TOPLAMM[/B] [/COLOR]+ Sheets(X).Range("F251")
TextBox2 = Format([COLOR=seagreen][B]TOPLAMM[/B][/COLOR], "#,##0.00")
Next
 
Üst