- Katılım
- 28 Ocak 2008
- Mesajlar
- 260
- Excel Vers. ve Dili
- 2003
Kimse yok mu ?
F1 F1 Help
F1 F1 Help
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Option Explicit
Sub TOPLA_AKTAR()
Dim S1 As Worksheet, S2 As Worksheet
Dim X As Long, Y As Long, Z As Integer
Dim BUL As Range
Dim ADRES As String
Set S1 = Sheets("Bilgiler")
Set S2 = Sheets("Transay Masraf")
For X = 3 To S2.[A65536].End(3).Row Step 4
S2.Range("C" & X & ":R" & X).ClearContents
Next
For Y = 3 To S2.[A65536].End(3).Row Step 4
If S2.Cells(Y, "S") > 0 Then
Set BUL = S1.[GY:GY].Find(S2.Cells(Y, 1))
If Not BUL Is Nothing Then
ADRES = BUL.Address
Do
S2.Cells(Y, "R") = Evaluate("=SUMPRODUCT((Bilgiler!GY2:GY5000=""" & S2.Cells(Y, "A") & """)*(Bilgiler!A2:A5000=""" & S2.Cells(2, "R") & """))")
For Z = 3 To 17
[COLOR=red] If Trim(S1.Cells(BUL.Row, "K")) = Trim(S2.Cells(2, Z)) Then[/COLOR]
S2.Cells(Y, Z) = S2.Cells(Y, Z) + 1
End If
Next
Set BUL = S1.[GY:GY].FindNext(BUL)
Loop While Not BUL Is Nothing And BUL.Address <> ADRES
End If
End If
Next
Set BUL = Nothing
Set S1 = Nothing
Set S2 = Nothing
MsgBox "İşleminiz tamamlanmıştır.", vbInformation
End Sub
Sub TOPLA_AKTAR2()
Dim S1 As Worksheet, S2 As Worksheet
Dim X As Long, Y As Long, Z As Integer
Dim BUL As Range
Dim ADRES As String
Set S1 = Sheets("Bilgiler")
Set S2 = Sheets("Transay Masraf")
For X = 3 To 71 Step 4
S2.Range("C" & X & ":R" & X).ClearContents
Next
For Y = 3 To 71 Step 4
If S2.Cells(Y, "S") > 0 Then
S2.Cells(Y, "R") = Evaluate("=SUMPRODUCT((Bilgiler!GY2:GY5000=""" & S2.Cells(Y, "A") & """)*(Bilgiler!A2:A5000=""" & S2.Cells(2, "R") & """))")
For Z = 3 To 17
S2.Cells(Y, Z) = Evaluate("=SUMPRODUCT((Bilgiler!GY2:GY5000=""" & S2.Cells(Y, "A") & """)*(Bilgiler!K2:K5000=""" & S2.Cells(2, Z) & """)*(Bilgiler!A2:A5000<>""" & S2.Cells(2, "R") & """))")
Next
End If
Next
Set S1 = Nothing
Set S2 = Nothing
MsgBox "İşleminiz tamamlanmıştır.", vbInformation
End Sub
Option Explicit
Sub TOPLA_AKTAR()
Dim S1 As Worksheet, S2 As Worksheet
Dim X As Long, Y As Long
Dim BUL As Range
Dim ADRES As String
Set S1 = Sheets("Bilgiler")
Set S2 = Sheets("Transay Masraf")
S2.Range("C3:R" & S2.[A65536].End(3).Row + 3).ClearContents
For X = 3 To S2.[A65536].End(3).Row Step 4
If S2.Cells(X, "S") > 0 Then
Set BUL = S1.[GY:GY].Find(S2.Cells(X, 1))
If Not BUL Is Nothing Then
ADRES = BUL.Address
Do
S2.Cells(X, "R") = Evaluate("=SUMPRODUCT((Bilgiler!GY2:GY5000=""" & S2.Cells(X, "A") & """)*(Bilgiler!A2:A5000=""" & S2.Cells(2, "R") & """))")
For Y = 3 To 17
If Trim(S1.Cells(BUL.Row, "K")) = Trim(S2.Cells(2, Y)) Then
S2.Cells(X, Y) = S2.Cells(X, Y) + 1
End If
Next
With S2.Range("C" & X + 2 & ":R" & X + 2)
.Formula = "=IF(C" & X & ">0,(C" & X & "/SUM($C$" & X & ":$R$" & X & ")*100),0)"
.Value = .Value
End With
With S2.Range("C" & X + 3 & ":R" & X + 3)
.Formula = "=IF(C" & X + 2 & ">0,$S$" & X & "*C" & X + 2 & "/100,"""")"
.Value = .Value
End With
Set BUL = S1.[GY:GY].FindNext(BUL)
Loop While Not BUL Is Nothing And BUL.Address <> ADRES
End If
End If
Next
Set BUL = Nothing
Set S1 = Nothing
Set S2 = Nothing
MsgBox "İşleminiz tamamlanmıştır.", vbInformation
End Sub