tristanfermat
Altın Üye
- Katılım
- 12 Haziran 2018
- Mesajlar
- 98
- Excel Vers. ve Dili
- Excel 365
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Sub Toplamlar()
Dim i As Long, _
t(3) As Double
For i = 2 To Cells(Rows.Count, "A").End(3).Row
If Cells(i, "C") = Date Then t(0) = t(0) + Cells(i, "B")
If (Year(Cells(i, "C")) = Year(Date)) And _
Application.WorksheetFunction.WeekNum(Cells(i, "C")) = Application.WorksheetFunction.WeekNum(Date) Then _
t(1) = t(1) + Cells(i, "B")
If (Year(Cells(i, "C")) = Year(Date)) And _
Month(Cells(i, "C")) = Month(Date) Then _
t(2) = t(2) + Cells(i, "B")
If (Year(Cells(i, "C")) = Year(Date)) Then t(3) = t(3) + Cells(i, "B")
Next i
Range("F3").Resize(4, 1) = Application.WorksheetFunction.Transpose(t)
MsgBox "Bitti...."
End Sub
Dim i As Long, _
t(3) As Double, _
sht As Worksheet
Set sht = Sheets("Tabelle1")
For i = 2 To sht.Cells(Rows.Count, "A").End(3).Row
If sht.Cells(i, "C") = Date Then t(0) = t(0) + sht.Cells(i, "B")
If (Year(sht.Cells(i, "C")) = Year(Date)) And _
Application.WorksheetFunction.WeekNum(sht.Cells(i, "C")) = Application.WorksheetFunction.WeekNum(Date) Then _
t(1) = t(1) + sht.Cells(i, "B")
If (Year(sht.Cells(i, "C")) = Year(Date)) And _
Month(sht.Cells(i, "C")) = Month(Date) Then _
t(2) = t(2) + sht.Cells(i, "B")
If (Year(sht.Cells(i, "C")) = Year(Date)) Then t(3) = t(3) + sht.Cells(i, "B")
Next i
Range("B2").Resize(4, 1) = Application.WorksheetFunction.Transpose(t)
MsgBox "Bitti...."
End Sub
Sub SuzToplamAl()
Dim i As Integer
Dim j As Long
Dim SonSat As Long
Dim t(3) As Double
Dim f
Dim Sht As Worksheet
Application.ScreenUpdating = False
Set Sht = Sheets("Tabelle1")
SonSat = Sht.Cells.Find("*", , , , xlByRows, xlPrevious).Row
f = Array(1, 4, 7, 13)
If Sht.AutoFilterMode = False Then Sht.Range("A1").AutoFilter
For i = 0 To 3
Sht.Range("$A$1:$C$" & SonSat).AutoFilter Field:=3, Criteria1:=Int(f(i)), Operator:=xlFilterDynamic
' j = Cells(Rows.Count, "B").End(3).Row
t(i) = t(i) + Sht.Range("B" & SonSat)
Next i
Range("B2").Resize(4, 1) = Application.WorksheetFunction.Transpose(t)
Sht.Range("A1").AutoFilter
Application.ScreenUpdating = True
End Sub