发新话题
打印

【求助】请高手帮忙优化VBA代码(请优化蓝色部分的代码)

【求助】请高手帮忙优化VBA代码(请优化蓝色部分的代码)

Windows("ST1&ST2.xls").Activate

   Sheets("ST1").Select

   Range("B8:CG137").ClearContents

   Sheets("ST2").Select

   Range("B8:CG137").ClearContents

   Windows("majus.csv").Activate

   Sheets("majus").Select

   Columns("C:H").Select

   Selection.Delete Shift:=xlToLeft

   Range("A1").Select

   Selection.AutoFilter

   Selection.AutoFilter Field:=1, Criteria1:="ST"

   Selection.AutoFilter Field:=2, Criteria1:="1"

   Range("A6:C6").Select

   Range(Selection, Selection.End(xlDown)).Select

   Selection.Copy

   Sheets("majus").Select

   Sheets.Add

   ActiveSheet.Paste Link:=True

   Range("C2:C130").Cut

   Range("D1").Select

   ActiveSheet.Paste

   Range("D2129").Cut

   Range("E1").Select

   ActiveSheet.Paste

        ......
   Range("DZ2Z3").Cut

   Range("EA1").Select

   ActiveSheet.Paste

   Range("EA2:EA2").Cut

   Range("EB1").Select

   ActiveSheet.Paste

   Range("A2:C2").Select

   Range(Selection, Selection.End(xlDown)).ClearContents

   Range("A1:EB1").AutoFill Destination:=Range("A1:EB128"), Type:=xlFillDefault

   Range("A1").Select

   Selection.AutoFilter

   Selection.AutoFilter Field:=1, Criteria1:="FP"

   Range("C4:EB121").Copy

   Windows("ST1&ST2.xls").Activate

   Sheets("ST1").Select

   Range("B8").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, Transpose:=True

   Windows("majus.csv").Activate

   Selection.AutoFilter Field:=1, Criteria1:="FR"

   Range("C5:EB122").Copy

   Windows("ST1&ST2.xls").Activate

   Range("8").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, Transpose:=True

   Windows("majus.csv").Activate

   Selection.AutoFilter Field:=1, Criteria1:="FZ"

   Range("C6:EB123").Copy

   Windows("ST1&ST2.xls").Activate

   Range("AD8").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, Transpose:=True

   Windows("majus.csv").Activate

   Selection.AutoFilter Field:=1, Criteria1:="RP"

   Range("C7:EB124").Copy

   Windows("ST1&ST2.xls").Activate

   Range("AR8").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, Transpose:=True

   Windows("majus.csv").Activate

   Selection.AutoFilter Field:=1, Criteria1:="RR"

   Range("C8:EB125").Copy

   Windows("ST1&ST2.xls").Activate

   Range("BF8").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, Transpose:=True

   Windows("majus.csv").Activate

   Selection.AutoFilter Field:=1, Criteria1:="RZ"

   Range("C9:EB126").Copy

   Windows("ST1&ST2.xls").Activate

   Range("BT8").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, Transpose:=True
发新话题