可以利用下面的VBA代码直接操作,具体操作直接按ALT+F8,
Sub 合并单元格插入序号()
Sub AutoNumberMergedCells()
Dim rng As Range, cell As Range
Dim i As Integer
i = 1
Set rng = Application.InputBox("选择合并单元格区域", Type:=8)
For Each cell In rng
If cell.MergeCells Then
If cell.Address = cell.MergeArea.Cells(1).Address Then
cell.Value = i
i = i + 1
End If
Else
cell.Value = i
创作者俱乐部成员
创作者俱乐部成员
创作者俱乐部成员
创作者俱乐部成员