我希望Excel在行的下一行上打印下个月的日期。 (第三行有一个计数器)
例如:
B28 = 01.07.2019 C24 = 01.06.2019 D16 = 01.02.2019 E19 = 01.07.2019
能请你帮我吗?
以下是屏幕截图:https://ibb.co/d0mW8GB
答案 0 :(得分:1)
您的问题中有很多遗漏的部分,但是我尝试创建代码来满足您的需求。您可以尝试:
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
结果:
答案 1 :(得分:0)
是的,您是对的。
缺少部分: