-
Sub biao1TObiao2()
Sheets("Sheet1").Select
Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
n1 = Selection.Rows.Count + 1
Selection.Copy
Sheets("Sheet2").Select
n2 = Application.CountA(Range("A:A"))
Range("D2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
If n1 > n2 Then
Range("A" & n2 & ":C" & n2).Select
Selection.AutoFill Destination:=Range("A" & n1 & ":C" & n2)
End If
If n1 < n2 Then Range(n1 + 1 & ":" & n2).Delete
End Sub
-
这个宏不是一两句能写好的,而且还要有表格数据参照,你把文件发我微信lrz19991上,我写好宏再传回给你。
如本站内容“对您有用”,欢迎随意打赏,让我们持续更新!
打赏