兰老师,我的程序运行真的是太慢了,帮我看看怎么可以快一点。谢谢 'B班数据分离************************************************************************* Sheets("Temp").Select '不良项目 Columns("C:C").Select Selection.Copy Columns("BP:BP").Select ActiveSheet.Paste '1 Columns("E:E").Select Selection.Cut Columns("BQ:BQ").Select ActiveSheet.Paste '2 Columns("G:G").Select Selection.Cut Columns("BR:BR").Select ActiveSheet.Paste '3 Columns("I:I").Select Selection.Cut Columns("BS:BS").Select ActiveSheet.Paste '4 Columns("K:K").Select Selection.Cut Columns("BT:BT").Select ActiveSheet.Paste '5 Columns("M:M").Select Selection.Cut Columns("BU:BU").Select ActiveSheet.Paste '6 Columns("O:O").Select Selection.Cut Columns("BV:BV").Select ActiveSheet.Paste '7 Columns("Q:Q").Select Selection.Cut Columns("BW:BW").Select ActiveSheet.Paste '8 Columns("S:S").Select Selection.Cut Columns("BX:BX").Select ActiveSheet.Paste '9 Columns("U:U").Select Selection.Cut Columns("BY:BY").Select ActiveSheet.Paste '10 Columns("W:W").Select Selection.Cut Columns("BZ:BZ").Select ActiveSheet.Paste '11 Columns("Y:Y").Select Selection.Cut Columns("CA:CA").Select ActiveSheet.Paste '12 Columns("AA:AA").Select Selection.Cut Columns("CB:CB").Select ActiveSheet.Paste '13 Columns("AC:AC").Select Selection.Cut Columns("CC:CC").Select ActiveSheet.Paste '14 Columns("AE:AE").Select Selection.Cut Columns("CD:CD").Select ActiveSheet.Paste '15 Columns("AG:AG").Select Selection.Cut Columns("CE:CE").Select ActiveSheet.Paste '16 Columns("AI:AI").Select Selection.Cut Columns("CF:CF").Select ActiveSheet.Paste '17 Columns("AK:AK").Select Selection.Cut Columns("CG:CG").Select ActiveSheet.Paste '18 Columns("AM:AM").Select Selection.Cut Columns("CH:CH").Select ActiveSheet.Paste '19 Columns("AO:AO").Select Selection.Cut Columns("CI:CI").Select ActiveSheet.Paste '20 Columns("AQ:AQ").Select Selection.Cut Columns("CJ:CJ").Select ActiveSheet.Paste '21 Columns("AS:AS").Select Selection.Cut Columns("CK:CK").Select ActiveSheet.Paste '22 Columns("AU:AU").Select Selection.Cut Columns("CL:CL").Select ActiveSheet.Paste '23 Columns("AW:AW").Select Selection.Cut Columns("CM:CM").Select ActiveSheet.Paste '24 Columns("AY:AY").Select Selection.Cut Columns("CN:CN").Select ActiveSheet.Paste '25 Columns("BA:BA").Select Selection.Cut Columns("CO:CO").Select ActiveSheet.Paste '26 Columns("BC:BC").Select Selection.Cut Columns("CP:CP").Select ActiveSheet.Paste '27 Columns("BE:BE").Select Selection.Cut Columns("CQ:CQ").Select ActiveSheet.Paste '28 Columns("BG:BG").Select Selection.Cut Columns("CR:CR").Select ActiveSheet.Paste '29 Columns("BI:BI").Select Selection.Cut Columns("CS:CS").Select ActiveSheet.Paste '30 Columns("BK:BK").Select Selection.Cut Columns("CT:CT").Select ActiveSheet.Paste '31 Columns("BM:BM").Select Selection.Cut Columns("CU:CU").Select ActiveSheet.Paste '合计 Columns("BO:BO").Select Selection.Cut Columns("CV:CV").Select ActiveSheet.Paste 'B班数据分离************************************************************************* '多余列删除 ************************************************************************* Range( _ "E:E,G:G,I:I,K:K,M:M,O:O,Q:Q,S:S,U:U,W:W,Y:Y,AA:AA,AC:AC,AE:AE,AG:AG,AI:AI,AK:AK,AM:AM,AO:AO,AQ:AQ,AS:AS,AU:AU,AW:AW,AY:AY,BA:BA,BC:BC,BE:BE,BG:BG,BI:BI,BK:BK,BM:BM" _ ).Select Range("BM1").Activate Selection.Delete Shift:=xlToLeft '多余列删除 ************************************************************************* '表格还原************************************************************************** Sheets("Temp").Select Columns("AK:AK").Select Selection.ClearContents '1 Columns("AL:AL").Select Selection.Cut Columns("E:E").Select Selection.Insert Shift:=xlToRight '2 Columns("AM:AM").Select Selection.Cut Columns("G:G").Select Selection.Insert Shift:=xlToRight '3 Columns("AN:AN").Select Selection.Cut Columns("I:I").Select Selection.Insert Shift:=xlToRight '4 Columns("AO:AO").Select Selection.Cut Columns("K:K").Select Selection.Insert Shift:=xlToRight '5 Columns("AP:AP").Select Selection.Cut Columns("M:M").Select Selection.Insert Shift:=xlToRight '6 Columns("AQ:AQ").Select Selection.Cut Columns("O:O").Select Selection.Insert Shift:=xlToRight '7 Columns("AR:AR").Select Selection.Cut Columns("Q:Q").Select Selection.Insert Shift:=xlToRight '8 Columns("AS:AS").Select Selection.Cut Columns("S:S").Select Selection.Insert Shift:=xlToRight '9 Columns("AT:AT").Select Selection.Cut Columns("U:U").Select Selection.Insert Shift:=xlToRight '10 Columns("AU:AU").Select Selection.Cut Columns("W:W").Select Selection.Insert Shift:=xlToRight '11 Columns("AV:AV").Select Selection.Cut Columns("Y:Y").Select Selection.Insert Shift:=xlToRight '12 Columns("AW:AW").Select Selection.Cut Columns("AA:AA").Select Selection.Insert Shift:=xlToRight '13 Columns("AX:AX").Select Selection.Cut Columns("AC:AC").Select Selection.Insert Shift:=xlToRight '14 Columns("AY:AY").Select Selection.Cut Columns("AE:AE").Select Selection.Insert Shift:=xlToRight '15 Columns("AZ:AZ").Select Selection.Cut Columns("AG:AG").Select Selection.Insert Shift:=xlToRight '16 Columns("BA:BA").Select Selection.Cut Columns("AI:AI").Select Selection.Insert Shift:=xlToRight '17 Columns("BB:BB").Select Selection.Cut Columns("AK:AK").Select Selection.Insert Shift:=xlToRight '18 Columns("BC:BC").Select Selection.Cut Columns("AM:AM").Select Selection.Insert Shift:=xlToRight '19 Columns("BD:BD").Select Selection.Cut Columns("AO:AO").Select Selection.Insert Shift:=xlToRight '20 Columns("BE:BE").Select Selection.Cut Columns("AQ:AQ").Select Selection.Insert Shift:=xlToRight '21 Columns("BF:BF").Select Selection.Cut Columns("AS:AS").Select Selection.Insert Shift:=xlToRight '22 Columns("BG:BG").Select Selection.Cut Columns("AU:AU").Select Selection.Insert Shift:=xlToRight '23 Columns("BH:BH").Select Selection.Cut Columns("AW:AW").Select Selection.Insert Shift:=xlToRight '24 Columns("BI:BI").Select Selection.Cut Columns("AY:AY").Select Selection.Insert Shift:=xlToRight '25 Columns("BJ:BJ").Select Selection.Cut Columns("BA:BA").Select Selection.Insert Shift:=xlToRight '26 Columns("BK:BK").Select Selection.Cut Columns("BC:BC").Select Selection.Insert Shift:=xlToRight '27 Columns("BL:BL").Select Selection.Cut Columns("BE:BE").Select Selection.Insert Shift:=xlToRight '28 Columns("BM:BM").Select Selection.Cut Columns("BG:BG").Select Selection.Insert Shift:=xlToRight '29 Columns("BN:BN").Select Selection.Cut Columns("BI:BI").Select Selection.Insert Shift:=xlToRight '30 Columns("BO:BO").Select Selection.Cut Columns("BK:BK").Select Selection.Insert Shift:=xlToRight '31 Columns("BP:BP").Select Selection.Cut Columns("BM:BM").Select Selection.Insert Shift:=xlToRight '合计 Columns("BQ:BQ").Select Selection.Cut Columns("BO:BO").Select Selection.Insert Shift:=xlToRight '清除 Range("4:149,152:968,971:1284,1287:1521").Select Selection.ClearContents '表格还原************************************************************************** '结束******************************************************************************************************************************* |