İlgili koda nasıl bir düzenleme yapılabilir

Akif59

Altın Üye
Katılım
15 Mart 2020
Mesajlar
66
Excel Vers. ve Dili
2013 ve 2016
Altın Üyelik Bitiş Tarihi
20-03-2025
Merhaba kod hesaplama yaptığı hücre aralığında boş hücrelere 0 değeri koyuyor boş hücreler de 0 değerini hücreye yazmayacak şekilde nasıl düzenlene bilir

Application.ScreenUpdating = False
If Intersect(Target, [DJ127:DJ131]) Is Nothing Then Exit Sub
a = Target.Row
If Target = "" Then
Range("D" & a & ":DI" & a).ClearContents
Exit Sub
End If
If IsNumeric(Target) = True Then
For k = 4 To 113
If Cells(123, k) <> "" Then
If a = 127 Then
Cells(a, k) = WorksheetFunction.RoundDown(Cells(123, k) / Target, 0)
ElseIf a = 128 Then
Cells(a, k) = WorksheetFunction.RoundDown((Cells(123, k) - (Cells(a - 1, k) * Cells(127, "DJ"))) / Target, 0)
ElseIf a = 129 Then
Cells(a, k) = WorksheetFunction.RoundDown((Cells(123, k) - (Cells(a - 1, k) * Cells(128, "DJ") + Cells(a - 2, k) * Cells(127, "DJ"))) / Target, 0)
ElseIf a = 130 Then
Cells(a, k) = WorksheetFunction.RoundDown((Cells(123, k) - (Cells(a - 1, k) * Cells(129, "DJ") + Cells(a - 2, k) * Cells(128, "DJ") + Cells(a - 3, k) * Cells(127, "DJ"))) / Target, 0)
Else
Cells(a, k) = WorksheetFunction.RoundDown((Cells(123, k) - (Cells(a - 1, k) * Cells(130, "DJ") + Cells(a - 2, k) * Cells(129, "DJ") + Cells(a - 3, k) * Cells(128, "DJ") + Cells(a - 4, k) * Cells(127, "DJ"))) / Target, 0)
End If
Else
Cells(a, k).ClearContents
End If
Next
Else
Range("D" & a & ":DI" & a).ClearContents
End If
End Sub
 

Akif59

Altın Üye
Katılım
15 Mart 2020
Mesajlar
66
Excel Vers. ve Dili
2013 ve 2016
Altın Üyelik Bitiş Tarihi
20-03-2025
Merhaba kod hesaplama yaptığı hücre aralığında boş hücrelere 0 değeri koyuyor boş hücreler de 0 değerini hücreye yazmayacak şekilde nasıl düzenlene bilir

Application.ScreenUpdating = False
If Intersect(Target, [DJ127:DJ131]) Is Nothing Then Exit Sub
a = Target.Row
If Target = "" Then
Range("D" & a & ":DI" & a).ClearContents
Exit Sub
End If
If IsNumeric(Target) = True Then
For k = 4 To 113
If Cells(123, k) <> "" Then
If a = 127 Then
Cells(a, k) = WorksheetFunction.RoundDown(Cells(123, k) / Target, 0)
ElseIf a = 128 Then
Cells(a, k) = WorksheetFunction.RoundDown((Cells(123, k) - (Cells(a - 1, k) * Cells(127, "DJ"))) / Target, 0)
ElseIf a = 129 Then
Cells(a, k) = WorksheetFunction.RoundDown((Cells(123, k) - (Cells(a - 1, k) * Cells(128, "DJ") + Cells(a - 2, k) * Cells(127, "DJ"))) / Target, 0)
ElseIf a = 130 Then
Cells(a, k) = WorksheetFunction.RoundDown((Cells(123, k) - (Cells(a - 1, k) * Cells(129, "DJ") + Cells(a - 2, k) * Cells(128, "DJ") + Cells(a - 3, k) * Cells(127, "DJ"))) / Target, 0)
Else
Cells(a, k) = WorksheetFunction.RoundDown((Cells(123, k) - (Cells(a - 1, k) * Cells(130, "DJ") + Cells(a - 2, k) * Cells(129, "DJ") + Cells(a - 3, k) * Cells(128, "DJ") + Cells(a - 4, k) * Cells(127, "DJ"))) / Target, 0)
End If
Else
Cells(a, k).ClearContents
End If
Next
Else
Range("D" & a & ":DI" & a).ClearContents
End If
End Sub
.
 
Üst