sirkülasyon
Altın Üye
- Katılım
- 10 Temmuz 2012
- Mesajlar
- 2,471
- Excel Vers. ve Dili
- 2021 LTSC TR
Kod:
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Dim Bak As Long
For Bak = 2 To 200
With Worksheets("Sayfa1")
If Cells(Bak, "D").Value = "" Or Cells(Bak, "E").Value = "" Then Exit Sub
.Cells(Bak, "F").Value = Day(Cells(Bak, "E").Value) + 30 * Month(Cells(Bak, "E").Value) + 360 * Year(Cells(Bak, "E").Value) - (Day(Cells(Bak, "D").Value) + 30 * Month(Cells(Bak, "D").Value) + 360 * Year(Cells(Bak, "D").Value))
.Cells(Bak, "G").Value = Int(Cells(Bak, "F").Value / 360)
.Cells(Bak, "H").Value = Int((Cells(Bak, "F").Value - Int(Cells(Bak, "F").Value / 360) * 360) / 30)
.Cells(Bak, "I").Value = Cells(Bak, "F").Value - Int(Cells(Bak, "F").Value / 360) * 360 - Int((Cells(Bak, "F").Value - Int(Cells(Bak, "F").Value / 360) * 360) / 30) * 30
End With
Next
End Sub