按ALT+F11打开VBA编辑器,插入一个模块,把如下代码放入,把光标停在代码第一行,按F5运行。Sub Macro1()For i = 1 To 50000 ' 根据列长度设置If Cells(i, 1) = "" Then End If IsNumeric(Right(Cells(i, 1), 2)) Thenx = Right(Cells(i, 1), 2)'截取从右2个字符Elsex = Right(Cells(i, 1), 1)'截取从右1个字符End IfFor j = 1 To x - 1 '循环插入行Cells(i, 1).SelectIf IsNumeric(Right(Ce
|