excel中如何补齐缺失的年月日?谢谢

2025-03-10 19:59:00
推荐回答(2个)
回答1:

C列补上0,那A列呢?如果A列不管,那你在SHEET2的B列B2输入198/0/01向下填充,然后在C2输入=IF(iserror(vlookup(B2,Sheet1!B:C,2,0)),0,vlookup(B2,Sheet1!B:C,2,0))向下填充。

回答2:

我在A列模拟的数据,根据实际情况自己改改

Sub tst()
Dim i As Integer
For i = 1 To 100
If Cells(i + 1, 1) > Cells(i, 1) + 1 Then
Cells(i + 1, 1).Insert shift:=xlDown
Cells(i + 1, 1) = Cells(i, 1) + 1
End If
Next
End Sub