topla dedikten sonra bitsin sonra tekrar toplasın

Katılım
10 Ağustos 2023
Mesajlar
28
Excel Vers. ve Dili
Microsoft 365 Tr-En 64 Bit
Microsoft Office 2013 Tr-En 64 Bit
Herkese Merhaba

arkadaşlar şöyle bir sorunum var "sayfa2" den "sayfa1 e" "malzeme çağır" butonuna basınca tek tek malzemeler geliyor tam istediğim gibi "topla" dediğim zaman da aşağıda topluyor ama ben bir kere daha malzeme ekle dedikten sonra topla bir kere daha basınca bütün sütunlar toplanıyor ben sadice ilk toplama işlemi bitti ilk seçilen malzeme getir bastığım zaman sadice en son toplanan getirilsin istiyorum bi yardımcı olursanız sevinirim.

 

Korhan Ayhan

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

B sütununda işlem yapar..

C++:
Option Explicit

Sub Topla()
    Dim Bul As Range
    
    Set Bul = Range("A1:A" & Cells(Rows.Count, 1).End(3).Row).Find("toplam*", Range("A18"), , xlWhole, , xlPrevious)
    If Not Bul Is Nothing Then
        If Left(Cells(Rows.Count, 1).End(3), 6) <> "toplam" Then
            Cells(Rows.Count, 1).End(3)(2, 1) = "toplam"
            Cells(Rows.Count, 2).End(3)(2, 1) = WorksheetFunction.Sum(Range("B" & Bul.Row + 1 & ":B" & Cells(Rows.Count, 2).End(3).Row))
        End If
    Else
        Cells(Rows.Count, 1).End(3)(2, 1) = "toplam"
        Cells(Rows.Count, 2).End(3)(2, 1) = WorksheetFunction.Sum(Range("B" & Cells(Rows.Count, 2).End(3).End(3).Row & ":B" & Cells(Rows.Count, 2).End(3).Row))
    End If
End Sub
 
Katılım
10 Ağustos 2023
Mesajlar
28
Excel Vers. ve Dili
Microsoft 365 Tr-En 64 Bit
Microsoft Office 2013 Tr-En 64 Bit
Deneyiniz.

B sütununda işlem yapar..

C++:
Option Explicit

Sub Topla()
    Dim Bul As Range
   
    Set Bul = Range("A1:A" & Cells(Rows.Count, 1).End(3).Row).Find("toplam*", Range("A18"), , xlWhole, , xlPrevious)
    If Not Bul Is Nothing Then
        If Left(Cells(Rows.Count, 1).End(3), 6) <> "toplam" Then
            Cells(Rows.Count, 1).End(3)(2, 1) = "toplam"
            Cells(Rows.Count, 2).End(3)(2, 1) = WorksheetFunction.Sum(Range("B" & Bul.Row + 1 & ":B" & Cells(Rows.Count, 2).End(3).Row))
        End If
    Else
        Cells(Rows.Count, 1).End(3)(2, 1) = "toplam"
        Cells(Rows.Count, 2).End(3)(2, 1) = WorksheetFunction.Sum(Range("B" & Cells(Rows.Count, 2).End(3).End(3).Row & ":B" & Cells(Rows.Count, 2).End(3).Row))
    End If
End Sub
hocam çok teşekkür ederim allah razı olsun
 
Üst