• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

makro ile topla çarpım

Katılım
6 Kasım 2006
Mesajlar
176
Excel Vers. ve Dili
türkçe
Kod:
=EĞER(A2="";"";TOPLA.ÇARPIM(--(Sipariş!A$8:A$8779=$A2);--(Sipariş!B$8:B$8779>=$O$1);--(Sipariş!B$8:B$8779<=$P$1);--(Sipariş!V$8:V$8779)))
Kod:
=EĞER(A2="";"";TOPLA.ÇARPIM(--(kesim!A$8:A$910=$A2);--(kesim!B$8:B$910>=$O$1);--(kesim!B$8:B$910<=$P$1);--(kesim!V$8:V$910)))
Kod:
=EĞER(A2="";"";TOPLA.ÇARPIM(--(dikim!A$8:A$910=$A2);--(dikim!B$8:B$910>=$O$1);--(dikim!B$8:B$910<=$P$1);--(dikim!V$8:V$910)))
ekteki formülleri makroya nasıl çevirebilirim.
 
Ömer bey merhaba
makro bilğim çok sınırlı o nedenle sordum ,emin olabilirsiniz bayağı araştırdım.
 
Merhaba.

En basit haliyle aşağıdaki gibi olabilir. A2 boş değilse B2'ye sonucu yazar.
İşlemi bir'den fazla satırda veya sütunda yapmak istiyorsanız; örnek belge yükleyerek daha farklı cevaplar da alabilirsiniz.
.
Kod:
[FONT="Arial Narrow"]If Cells([B][COLOR="Red"]2[/COLOR], [COLOR="Blue"]1[/COLOR][/B]) [B]<>[/B] "" Then Cells([B][COLOR="SeaGreen"]2[/COLOR][/B], [COLOR="purple"][B]2[/B][/COLOR]) = Evaluate("=SUMPRODUCT(--(kesim!A$8:A$910=$A2),--(kesim!B$8:B$910>=$Q$1),--(kesim!B$8:B$910<=$P$1),--(kesim!V$8:V$910))")[/FONT]
 
Bu şekilde hallettim teşekkürler Ömer bey.

Kod:
 Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, [a1:a15000]) Is Nothing Then
Set sp = Sheets("Sipariş")
    
Range("h2:k33").ClearContents
For h = 2 To WorksheetFunction.CountA(Range("a:a")) + 1
Cells(h, 8).Value = Evaluate("SumProduct((kesim!A8:A117=A" & h & ")*(kesim!c8:c117=B" & h & ")*(kesim!v8:v117))")
Cells(h, 9).Value = Evaluate("SumProduct((dikim!A8:A117=A" & h & ")*(dikim!c8:c117=B" & h & ")*(dikim!v8:v117))")
Cells(h, 10).Value = Evaluate("SumProduct((yükleme!A8:A117=A" & h & ")*(yükleme!c8:c117=B" & h & ")*(yükleme!v8:v117))")
Cells(h, 11).Value = Evaluate("SumProduct((2.kalite!A8:A117=A" & h & ")*(2.kalite!c8:c117=B" & h & ")*(2.kalite!v8:v117))")

Next h
     End If
     
End Sub
 
#DEĞER, Error 2015, type mismatch error 13 Hatası

Kod:
Sub Makro6() ''''''''''AKTAR
Dim Sf As Worksheet
Set Sf = ThisWorkbook.Worksheets("eksik")
sonsat = Sf.Cells(655, 3).End(3).Row + 3
    
Sf.Range("A2:q" & sonsat).Select
    Range("g2:q333").ClearContents
 For h = 2 To WorksheetFunction.CountA(Range("a:a")) + 1
 Cells(h, 7).Value = Evaluate("SumProduct((sipariş!A8:A1117=A" & h & ")*(sipariş!c8:c1117=B" & h & ")*(sipariş!v8:v1117))")
Cells(h, 8).Value = Evaluate("SumProduct((kesim!A8:A1117=A" & h & ")*(kesim!c8:c1117=B" & h & ")*(kesim!v8:v1117))")
Cells(h, 9).Value = Evaluate("SumProduct((dikim!A8:A1117=A" & h & ")*(dikim!c8:c1117=B" & h & ")*(dikim!v8:v1117))")
Cells(h, 10).Value = Evaluate("SumProduct((paket!A8:A1117=A" & h & ")*(paket!c8:c1117=B" & h & ")*(paket!v8:v1117))")
Cells(h, 11).Value = Evaluate("SumProduct((2.kalite!A8:A1117=A" & h & ")*(2.kalite!c8:c1117=B" & h & ")*(2.kalite!v8:v1117))")
Cells(h, 14).Value = Evaluate("SumProduct((f.data!A8:A1117=A" & h & ")*(f.data!c8:c1117=B" & h & ")*(f.data!v8:v1117))")

Next h
For i = 2 To 90

    If Range("j" & i).Value > 1 Then Range("L" & i).Value = Range("J" & i).Value +[COLOR="Red"] Range("K" & i).Value
[/COLOR]
Next

End Sub


sorunsuz çalışan kodlarım hata vermeye başladı.
2.kalite sayfasından alınan veriler hata veriyor.neden olduğunu çözemedim.
 
Merhaba.

Aşağıdaki gibi deneyin.
.
Kod:
[B][COLOR="Blue"]Sub Makro6()[/COLOR][/B] ''''''''''AKTAR
Dim Sf As Worksheet
Set Sf = ThisWorkbook.Worksheets("eksik")
sonsat = [COLOR="red"]Sf.[/COLOR]Cells(Rows.Count, 3).End(3).Row + 3
[COLOR="red"]Sf.[/COLOR]Range("g2:q333").ClearContents
For h = 2 To WorksheetFunction.CountA([COLOR="red"]Sf.[/COLOR]Range("a:a")) + 1
    [COLOR="red"]Sf.[/COLOR]Cells(h, 7).Value = Evaluate("=SumProduct((sipariş!A8:A1117=[COLOR="red"]eksik!A[/COLOR]" & h & ")*(sipariş!c8:c1117=[COLOR="red"]eksik!B[/COLOR]" & h & ")*(sipariş!v8:v1117))")
    [COLOR="red"]Sf.[/COLOR]Cells(h, 8).Value = Evaluate("=SumProduct((kesim!A8:A1117=[COLOR="red"]eksik!A[/COLOR]" & h & ")*(kesim!c8:c1117=[COLOR="red"]eksik!B[/COLOR]" & h & ")*(kesim!v8:v1117))")
    [COLOR="red"]Sf.[/COLOR]Cells(h, 9).Value = Evaluate("=SumProduct((dikim!A8:A1117=[COLOR="red"]eksik!A[/COLOR]" & h & ")*(dikim!c8:c1117=[COLOR="red"]eksik!B[/COLOR]" & h & ")*(dikim!v8:v1117))")
    [COLOR="red"]Sf.[/COLOR]Cells(h, 10).Value = Evaluate("=SumProduct((paket!A8:A1117=[COLOR="red"]eksik!A[/COLOR]" & h & ")*(paket!c8:c1117=[COLOR="red"]eksik!B[/COLOR]" & h & ")*(paket!v8:v1117))")
    [COLOR="red"]Sf.[/COLOR]Cells(h, 11).Value = Evaluate("=SumProduct((2.kalite!A8:A1117=[COLOR="red"]eksik!A[/COLOR]" & h & ")*(2.kalite!c8:c1117=[COLOR="red"]eksik!B[/COLOR]" & h & ")*(2.kalite!v8:v1117))")
    [COLOR="red"]Sf.[/COLOR]Cells(h, 12) = [COLOR="red"]Sf.[/COLOR]Cells(h, 10) + [COLOR="Red"]Sf.[/COLOR]Cells(h, 11)
    [COLOR="red"]Sf.[/COLOR]Cells(h, 14).Value = Evaluate("=SumProduct((f.data!A8:A1117=[COLOR="Red"]eksik!A[/COLOR]" & h & ")*(f.data!c8:c1117=[COLOR="red"]eksik!B[/COLOR]" & h & ")*(f.data!v8:v1117))")
Next h
[B][COLOR="Blue"]End Sub[/COLOR][/B]
 
Geri
Üst