我想通过一个弹出框添加x天数到一个长日期.
Public Function AskForDeadlinePlus4() As String
Dim strUserResponse As String
strUserResponse = InputBox("Enter Validuntil Date: Add # of Days To Survey end date")
strUserResponse = FormatDateTime(strUserResponse + I2, vbLongDate)
ActiveSheet.Cells(2, 10).Value = strUserResponse 'the 2, 10 is the cell reference for J2 - row 2, column 10.
End Function
Run Code Online (Sandbox Code Playgroud)
调查结束日期在单元格I2中.
当我运行这个我得到(谷歌搜索如何做到这一点,我很累)
4 + I2(何处I2 = Friday, April 05, 2013)>> Wednesday, January 03, 1900
当然我需要 Tuesday, April 09, 2013
谢谢