|
本帖最后由 对你微笑 于 2013-2-14 22:00 编辑
Sub 插入空缺的日期()
Dim i&, r&, a&, j&
Sheet1.Activate
r = [a65536].End(xlUp).Row
For i = r To 3 Step -1
If CDate(Cells(i, 4)) <> CDate(Cells(i - 1, 4)) + 1 Then
a = CDate(Cells(i, 4)) - CDate(Cells(i - 1, 4))
Rows(i & ":" & i + a - 2).Insert
For j = i To i + a - 2
Cells(j, 4) = CDate(Cells(j - 1, 4)) + 1
Next j
End If
Next
End Sub
为何我运行到If CDate(Cells(i, 4)) <> CDate(Cells(i - 1, 4)) + 1 Then出现“运行时错误‘13’类型不匹配
插入行并填充日期.rar
(127.79 KB, 下载次数: 18)
|
|