|
发表于 2014-12-29 15:41
|
显示全部楼层
本楼为最佳答案
- Private Sub Worksheet_Change(ByVal Target As Range)
- If Target.Count > 1 Then Exit Sub
- x = Target.Row
- If Target.Column < 9 Or Target.Column > 10 Or x < 3 Then Exit Sub
- Application.EnableEvents = False
- Cells(x, 1) = x - 2 '编号
- Cells(x, 7) = Cells(x, 5) - Cells(x, 4) '协议天数
- Cells(x, 8) = IIf(Cells(x, 6) = "", Cells(x, 7), Cells(x, 6) - Cells(x, 4)) '实际天数
-
- a = Cells(x, 3): b = Cells(x, 7)
- d = Cells(x, 9): e = Cells(x, 10)
- Cells(x, 11) = Round(a * d * b / 360 * 10000 + 0.0001, 2) '协议利率
- Cells(x, 12) = IIf(Cells(x, 10) = "", Cells(x, 11), Round(a * e * b / 360 * 10000 + 0.0001, 2)) '实际利率
-
- If IsDate(Cells(x, 5)) Then '是否划回
- If Cells(x, 5) <= Date Then Cells(x, "M") = "已划回" Else Cells(x, "M") = "未划回"
- End If
- If IsDate(Cells(x, 6)) Then
- If Cells(x, 6) <= Date Then Cells(x, "M") = "已划回" Else Cells(x, "M") = "未划回"
- End If
- Application.EnableEvents = True
- End Sub
复制代码 |
|