- Katılım
- 5 Kasım 2007
- Mesajlar
- 4,727
- Excel Vers. ve Dili
- 64 Bit TR - Microsoft Office 365 - Win11 Home
Merhaba,
Aşağıdaki kod daha kısa nasıl yazılabilir ?
Teşekkür ederim.
Aşağıdaki kod daha kısa nasıl yazılabilir ?
Teşekkür ederim.
Kod:
Sub ÜyeAidatListesi()
On Error Resume Next
Dim i As Long
Sheets("ÜYE_AİDAT_LİSTESİ").Select
Dim S1 As Worksheet
Set S1 = Sheets("ÜYE_AİDAT_LİSTESİ")
Range("D3:O" & Rows.Count).ClearContents
S1.Unprotect "12345"
For i = 3 To Cells(Rows.Count, "B").End(xlUp).Row
Cells(i, "D") = Evaluate("=SUMPRODUCT((Aidat_Raporu!D2:D5000=" & Cells(i, "B").Address() & ")" & _
"*(Aidat_Raporu!G2:G5000=D2)*(Aidat_Raporu!J2:J5000=D1)*(Aidat_Raporu!F2:F5000))")
Cells(i, "E") = Evaluate("=SUMPRODUCT((Aidat_Raporu!D2:D5000=" & Cells(i, "B").Address() & ")" & _
"*(Aidat_Raporu!G2:G5000=E2)*(Aidat_Raporu!J2:J5000=D1)*(Aidat_Raporu!F2:F5000))")
Cells(i, "F") = Evaluate("=SUMPRODUCT((Aidat_Raporu!D2:D5000=" & Cells(i, "B").Address() & ")" & _
"*(Aidat_Raporu!G2:G5000=F2)*(Aidat_Raporu!J2:J5000=D1)*(Aidat_Raporu!F2:F5000))")
Cells(i, "G") = Evaluate("=SUMPRODUCT((Aidat_Raporu!D2:D5000=" & Cells(i, "B").Address() & ")" & _
"*(Aidat_Raporu!G2:G5000=G2)*(Aidat_Raporu!J2:J5000=D1)*(Aidat_Raporu!F2:F5000))")
Cells(i, "H") = Evaluate("=SUMPRODUCT((Aidat_Raporu!D2:D5000=" & Cells(i, "B").Address() & ")" & _
"*(Aidat_Raporu!G2:G5000=H2)*(Aidat_Raporu!J2:J5000=D1)*(Aidat_Raporu!F2:F5000))")
Cells(i, "I") = Evaluate("=SUMPRODUCT((Aidat_Raporu!D2:D5000=" & Cells(i, "B").Address() & ")" & _
"*(Aidat_Raporu!G2:G5000=I2)*(Aidat_Raporu!J2:J5000=D1)*(Aidat_Raporu!F2:F5000))")
Cells(i, "J") = Evaluate("=SUMPRODUCT((Aidat_Raporu!D2:D5000=" & Cells(i, "B").Address() & ")" & _
"*(Aidat_Raporu!G2:G5000=J2)*(Aidat_Raporu!J2:J5000=D1)*(Aidat_Raporu!F2:F5000))")
Cells(i, "K") = Evaluate("=SUMPRODUCT((Aidat_Raporu!D2:D5000=" & Cells(i, "B").Address() & ")" & _
"*(Aidat_Raporu!G2:G5000=K2)*(Aidat_Raporu!J2:J5000=D1)*(Aidat_Raporu!F2:F5000))")
Cells(i, "L") = Evaluate("=SUMPRODUCT((Aidat_Raporu!D2:D5000=" & Cells(i, "B").Address() & ")" & _
"*(Aidat_Raporu!G2:G5000=L2)*(Aidat_Raporu!J2:J5000=D1)*(Aidat_Raporu!F2:F5000))")
Cells(i, "M") = Evaluate("=SUMPRODUCT((Aidat_Raporu!D2:D5000=" & Cells(i, "B").Address() & ")" & _
"*(Aidat_Raporu!G2:G5000=M2)*(Aidat_Raporu!J2:J5000=D1)*(Aidat_Raporu!F2:F5000))")
Cells(i, "N") = Evaluate("=SUMPRODUCT((Aidat_Raporu!D2:D5000=" & Cells(i, "B").Address() & ")" & _
"*(Aidat_Raporu!G2:G5000=N2)*(Aidat_Raporu!J2:J5000=D1)*(Aidat_Raporu!F2:F5000))")
Cells(i, "O") = Evaluate("=SUMPRODUCT((Aidat_Raporu!D2:D5000=" & Cells(i, "B").Address() & ")" & _
"*(Aidat_Raporu!G2:G5000=O2)*(Aidat_Raporu!J2:J5000=D1)*(Aidat_Raporu!F2:F5000))")
Next i
S1.Protect "12345"
End Sub
