|
Sub 对帐单()
'
' 对帐单 宏
Columns("A:B").Select
Range("表29[[#Headers],[序号]]").Activate
Selection.Delete Shift:=xlToLeft
Columns("L:R").Select
Selection.Delete Shift:=xlToLeft
Range("K2").Select
Range(Selection, Selection.End(xlDown)).Select
Range("表29[[#Data],[#Totals],[金 额]]").Select
Range("表29[[#Totals],[金 额]]").Activate
ActiveCell.FormulaR1C1 = "=SUM(R[-5]C:R[-1]C)"
Rows("1:1").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Range("A1:K1").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
Range("A1:K1").Select
ActiveCell.FormulaR1C1 = "对帐单)"
Range("表29[#All]").Select
Selection.Copy
End Sub
如何把代码中的 表29 替换为当前工作薄,因换工作薄了就执行不了,谢大师指点一下!
|
|