![to8go目前处于离线状态](https://user.hlgnet.com/face/Image18.gif) |
等 级:长老 |
经 验 值:1609 |
魅 力 值:162 |
龙 币:3756 |
积 分:1851.4 |
注册日期:2002-12-03 |
|
|
|
加了一段代码,这次应该是比较完善了,不会在末尾出现表头了
Sub 宏1()
For n = 1 To 10000
aa = 4 + (n - 1)
bb = 5 + (n - 1)
cc = 7 + (n - 1)
dd = CStr(bb) + ":" + CStr(cc)
If Range("A" & aa).Value <> Range("A" & bb).Value And Range("A" & bb).Value <> "" Then
Rows(dd).Select
Selection.Insert Shift:=xlDown
Range("1:3").Select
Selection.Copy
Range("A" & bb).Select
ActiveSheet.Paste
n = n + 3
End If
Next n
End Sub
|
|
|
|