|
Sub 测试33()
'
' 测试33 Macro
'
'
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
ActiveCell.Offset(0, 7).Range("A1").Select
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-4],'[我的.xlsx]Sheet1'!R1C5:R52981C25,10,0)"
Selection.AutoFill Destination:=ActiveCell.Range("A1:A540"), Type:= _
xlFillDefault
ActiveCell.Range("A1:A540").Select
ActiveCell.Offset(0, 5).Range("A1").Select
ActiveCell.FormulaR1C1 = "=AVERAGE(R2C8:R[539]C[-5])"
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveWindow.SmallScroll Down:=-18
ActiveCell.Offset(-1, 0).Range("A1").Select
Selection.Copy
ActiveCell.Offset(1, 0).Range("A1:A539").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.NumberFormatLocal = "0_ "
ActiveCell.Offset(-1, 0).Range("A1").Select
Selection.NumberFormatLocal = "0_ "
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=RC[-1]/RC[-6]"
ActiveCell.Select
Selection.AutoFill Destination:=ActiveCell.Range("A1:A540")
ActiveCell.Range("A1:A540").Select
ActiveCell.Rows("1:1").EntireRow.Select
ActiveCell.Offset(0, -11).Range("A1").Activate
ActiveWindow.SmallScroll Down:=6
ActiveCell.Rows("1:540").EntireRow.Select
ActiveCell.Activate
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=ActiveCell. _
Offset(0, 11).Range("A1:A540"), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Sheet1").Sort
.SetRange ActiveCell.Offset(0, -2).Range("A1:U540")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
请问哪里出错了,系统报错“定义的应用程序错误”
怎么办?
|
|