VBA macro解决办法

fieldset{padding:10px;}

VBA macro

SubMacro1()IfMsgBox("DoyouwanttosorttheSEMILABdatanow?",vbOKCancel,"MessageBox")=vbCancelThenExitSub'***SelectAllRange***ActiveSheet.Range("A1:AC40000").Select'***WithAllBorders***WithSelection.Borders.LineStyle=xlContinuous.Weight=xlThin.ColorIndex=xlAutomaticEndWith'***DeleteColumns***Columns("A:A").SelectSelection.DeleteShift:=xlToLeft'***DeleteRows***DimCurrentSheetAsObject'Loopthroughallselectedsheets.ForEachCurrentSheetInActiveWindow.SelectedSheetsCurrentSheet.Range("1:1,3:3").EntireRow.DeleteNext'***InsertText***Range("W1").SelectActiveCell=ActiveCell&"Blockno"Range("X1").SelectActiveCell=ActiveCell&"IngotNo."Range("Y1").SelectActiveCell=ActiveCell&"FurID"Range("Z1").SelectActiveCell=ActiveCell&"Position"Range("AA1").SelectActiveCell=ActiveCell&"FurRun"Range("AB1").SelectActiveCell=ActiveCell&"Fac"'***InsertFormula***Range("W2").Formula="=RIGHT(A2,2)"Range("X2").Formula="=LEFT(A2,11)"Range("Y2").Formula="=VLOOKUP(X2,Ingot!$A$4:$F$2500,5,FALSE)"Range("Z2").Formula="=VLOOKUP(X2,Ingot!$A$4:$G$2500,7,FALSE)"Range("AA2").Formula="=VLOOKUP(X2,Ingot!$A$4:$F$2500,6,FALSE)"Range("AB2").Formula="=LEFT(A2,6)"EndWith'***DragandDrop***Range("W2").AutoFillDestination:=Range("W2:W"&Cells(Rows.Count,1).End(xlUp).Row)Range("X2").AutoFillDestination:=Range("X2:X"&Cells(Rows.Count,1).End(xlUp).Row)Range("Y2").AutoFillDestination:=Range("Y2:Y"&Cells(Rows.Count,1).End(xlUp).Row)Range("Z2").AutoFillDestination:=Range("Z2:Z"&Cells(Rows.Count,1).End(xlUp).Row)Range("AA2").AutoFillDestination:=Range("AA2:AA"&Cells(Rows.Count,1).End(xlUp).Row)Range("AB2").AutoFillDestination:=Range("AB2:AB"&Cells(Rows.Count,1).End(xlUp).Row)DimstrTextAsStringIfMsgBox("Sortingisdone!",vbOKOnly,"MessageBox")=vbOKThenExitSubExitSubEndSub

——解决方案——————————————————–呵呵,感谢楼主!——解决方案——————————————————–Oh,mygod!Thesecodeareverygood.ButIdon’tunderstand.Whatareyoudoingnow?Thisisatest?Whatdoyoutesting?太过于近,彼此身上隐性的刺又会深深的伤害对方。

VBA macro解决办法

相关文章:

你感兴趣的文章:

标签云: