VBA Excel循环一年中的所有日子
在Excel VBA中:
我如何循环在给定的date范围内的所有日子?
'2013-01-01'到'2013-01-03'应该给:
2013-01-01 2013-01-02 2013-01-03
这至less应该告诉你如何开始你想要做的事情:
Sub test() Dim StartDate As Date Dim EndDate As Date Dim DateLooper As Date StartDate = #1/1/2013# EndDate = #12/31/2013# For DateLooper = StartDate To EndDate MsgBox (DateLooper) Next DateLooper End Sub