Saturday, June 26, 2010

How to Subtract the given no.of days from today



Sub Sub_dates()

x = InputBox("Enter the no.of days to be subtracted from today's date")
y = DateAdd("d", -x, Now)
z = Mid(y, 1, InStr(1, y, " ") - 1)

MsgBox z
End Sub

No comments:

Post a Comment