【发布时间】:2019-10-16 02:45:11
【问题描述】:
我希望 excel 在下一行打印下个月的日期。 (第三排有柜台)
例如:
B28 = 01.07.2019
C24 = 01.06.2019
D16 = 01.02.2019
E19 = 01.07.2019
【问题讨论】:
标签: excel vba excel-2010
我希望 excel 在下一行打印下个月的日期。 (第三排有柜台)
例如:
B28 = 01.07.2019
C24 = 01.06.2019
D16 = 01.02.2019
E19 = 01.07.2019
【问题讨论】:
标签: excel vba excel-2010
您的问题有很多缺失的部分,但我尝试创建一个代码来满足您的需求。你可以试试:
Option Explicit
Sub makro3()
Dim LastColumn As Long, LastRow As Long, Column As Long, Row As Long, Paid As Long
'In your quetion there is no starting date so i use the current one
With ThisWorkbook.Sheets("Sheet1")
LastColumn = .Cells(3, .Columns.Count).End(xlToLeft).Column
For Column = 2 To LastColumn
Paid = .Cells(3, Column).Value
For Row = 1 To Paid
LastRow = .Cells(.Rows.Count, Column).End(xlUp).Row
.Cells(LastRow + 1, Column).Value = DateAdd("m", Row, Date)
Next Row
Next Column
End With
End Sub
结果:
【讨论】: