°õ¦æ¥H¤Uµ{¦¡·|¥X²{ ¡i°õ¦æ¶¥¬q¿ù»~"11" °£¥H¹s¡j°T®§µøµ¡
m = Application.Max(0, Round((.Range("f1") - (B + B.Offset(, 1))) / B.Offset(, 1), 0))
¤W±µ{¦¡½X¬°¿ù»~´yz~~½Ð°Ýn¦p¦ó×¥¿°Ç
°õ¦æÀɮפº®e¦p¹ÏÀÉ
Private Sub CommandButton1_Click()
With Sheet1
Set Rng = .Range(.[D5], .[D65536].End(xlUp))
For Each B In Rng
If IsDate(B) And (B + B.Offset(, 1) < .Range("f1")) Then
m = Application.Max(0, Round((.Range("f1") - (B + B.Offset(, 1))) / B.Offset(, 1), 0))
B.Offset(, 3) = B + B.Offset(, 1) + m * B.Offset(, 1)
ElseIf IsDate(B) And (B + B.Offset(, 1) > .Range("f1")) Then
B.Offset(, 3) = B + B.Offset(, 1)
End If
Next
End With
End Sub |