Kod:
Sub Diz()
Application.ScreenUpdating = False
Range("J3:L100") = ""
Range("AH1:BZ1000") = ""
son = Cells(Rows.Count, 2).End(3).Row
Range("B2:C" & son).Sort Range("B2"), xlAscending
For i = son To 2 Step -1
If Cells(i, 3) = "" Or Cells(i, 3) = 0 Then GoTo 10
süt = WorksheetFunction.CountA(Range("AH12:BZ12")) + 34
Cells(12, süt) = Cells(i, 2).Value
Cells(11, süt) = Cells(i, 3).Value
Cells(13, süt) = 0
10
Next
x = WorksheetFunction.CountA(Range("AH12:BZ12")) + 33
Range(Cells(14, 34), Cells(1000, x)) = "=IF(ROW(A1)>AH$11,"""",AH$12+AH13)"
Range(Cells(14, 34), Cells(1000, x)) = Range(Cells(14, 34), Cells(1000, x)).Value
Range(Cells(6, 34), Cells(6, x)) = 0
Range("AH3") = "=H3"
Range(Cells(7, 34), Cells(7, x)) = "=MATCH(AH$3,AH$13:AH$1000,1)-AH6"
Range(Cells(3, 35), Cells(3, x)) = "=ROUND(AH3-AH8,2)"
Range(Cells(8, 34), Cells(8, x)) = "=(AH7-1)*AH$12"
Range(Cells(9, 34), Cells(9, x)) = "=AH7-1"
Range("AH1") = "=IF(AH3=AJ1,1,0)"
Range("AJ1") = "=SUM(AH8:BZ8)"
End Sub
Sub Yaz()
For i = 34 To 100
If Cells(9, i) = "" Then Exit Sub
If Cells(9, i) = 0 Then GoTo 10
son = Cells(Rows.Count, 10).End(3).Row + 1
Cells(son, 10) = Cells(12, i).Value
Cells(son, 11) = Cells(9, i).Value
Cells(son, 12) = Cells(son, 11) * Cells(son, 10)
10
Next
End Sub
Sub Stoktan_Düş()
If Range("J3") = "" Then Exit Sub
son = Cells(Rows.Count, 10).End(3).Row
For i = 3 To son
x = WorksheetFunction.Match(Cells(i, 10), Range("B1:B100"), 0)
Cells(x, 3) = Cells(x, 3) - Cells(i, 11)
Next
Range("H3") = ""
End Sub
Sub Yeni()
If Range("AH1") = 1 Then Exit Sub
t = WorksheetFunction.CountA(Range("AH6:BZ6")) + 33
For i = t To 34 Step -1
Range(Cells(6, 34), Cells(6, t)) = 0
For j = i To t
If Cells(7, j) < 2 Then GoTo 20
Cells(6, j) = Cells(6, j) + 1
If Range("AH1") = 1 Then Exit Sub
20
Next
Next
End Sub
Bu kodlama bütün işlemler A ve O sütunları arasını ilgilendirdiği halde AH1:BZ1000 AH12:BZ12 AH1 AH3 AJ1 kodlamada geçmesinin hikmetini anlayamadım.
Bunlar BZ arasına tablolar eklediğimde A O sütunları arasındaki hesap tablom çalışmıyor. Ne yapabilirim ?
