且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

VBA根据日期范围自动返回日期

更新时间:2023-01-30 08:35:40

Sub returnDates()
    Dim QuotationStartD As Date, QuotationStartD As Date
    QuotationStartD = Cells(5, 3)
    QuotationEndD = Cells(6, 3)
    For Row = 1 To (QuotationEndD - QuotationStartD)
        MsgBox QuotationStartD + Row - 1   ' put your sheet and cells
    Next Row
End Sub