- Sub 使单元格标号顺序连续()
- Dim a As Integer, b As Integer, c As Integer
- On Error Resume Next
- For a = 2 To 535
- If Cells(a + 1, 1) - Cells(a, 1) <> 1 Then
- b = Cells(a + 1, 1) - Cells(a, 1) - 1
- If b < 0 Then
- Cells(a + 1, 1) = Cells(a, 1) + 1
- End If
- c = a + 1
- Rows(c).Resize(b).Insert
- Cells(a + 1, 1) = Cells(a, 1) + 1
- End If
- Next
- End Sub
复制代码 |