首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > VB Dotnet >

testing,该怎么解决

2012-01-07 
testingVB.NET codeSub Macro2()If MsgBox(Do you want to sort the YIELD data now?, vbOKCancel, Mes

testing

VB.NET code
Sub Macro2()If MsgBox("Do you want to sort the YIELD data now?", vbOKCancel, "Message Box") = vbCancel Then Exit Sub'***Select All Range***ActiveSheet.Range("A1:BD4980").Select'***With All Borders***With Selection.Borders        .LineStyle = xlContinuous        .Weight = xlThin        .ColorIndex = xlAutomaticEnd With'***Delete Columns***Columns("A:A").SelectSelection.Delete Shift:=xlToLeft'***Delete Rows***Dim CurrentSheet As Object' Loop through all selected sheets.For Each CurrentSheet In ActiveWindow.SelectedSheets    CurrentSheet.Range("1:1,3:3").EntireRow.DeleteNext'***Font Style***With ActiveCell.Characters(Start:=1, Length:=10000).Font.name = "Calibri".FontStyle = "Regular".Size = 8.Strikethrough = False.Superscript = False.Subscript = False.OutlineFont = False.Shadow = False.Underline = xlUnderlineStyleNone.ColorIndex = xlAutomatic'***Insert Text***Range("AS1").SelectActiveCell = ActiveCell & "Block no"Range("AT1").SelectActiveCell = ActiveCell & "Ingot No."Range("AU1").SelectActiveCell = ActiveCell & "Fur ID"Range("AV1").SelectActiveCell = ActiveCell & "Position"Range("AW1").SelectActiveCell = ActiveCell & "Fur Run"Range("AX1").SelectActiveCell = ActiveCell & "Saw-Mark%"Range("AY1").SelectActiveCell = ActiveCell & "DI%"Range("AZ1").SelectActiveCell = ActiveCell & "NCVD%"Range("BA1").SelectActiveCell = ActiveCell & "A-Wafer"Range("BB1").SelectActiveCell = ActiveCell & "A5"Range("BC1").SelectActiveCell = ActiveCell & "Manual removal"'***Insert Formula***Range("AS2").Formula = "=RIGHT(A2,2)"Range("AT2").Formula = "=LEFT(A2,11)"Range("AU2").Formula = "=VLOOKUP(AT2,Ingot!$A$4:$F$2500,5,FALSE)"Range("AV2").Formula = "=VLOOKUP(AT2,Ingot!$A$4:$G$2500,7,FALSE)"Range("AW2").Formula = "=VLOOKUP(AT2,Ingot!$A$4:$F$2500,6,FALSE)"Range("AX2").Formula = "=(AL2/L2)*100"Range("AY2").Formula = "=(AM2/L2)*100"Range("AZ2").Formula = "=(AQ2/L2)*100"Range("BA2").Formula = "=(N2/L2)*100"Range("BB2").Formula = "=N2-580"Range("BC2").Formula = "=(L2-M2)/L2*100"End With'***Drag and Drop***Range("AS2").AutoFill Destination:=Range("AS2:AS" & Cells(Rows.Count, 1).End(xlUp).Row)Range("AT2").AutoFill Destination:=Range("AT2:AT" & Cells(Rows.Count, 1).End(xlUp).Row)Range("AU2").AutoFill Destination:=Range("AU2:AU" & Cells(Rows.Count, 1).End(xlUp).Row)Range("AV2").AutoFill Destination:=Range("AV2:AV" & Cells(Rows.Count, 1).End(xlUp).Row)Range("AW2").AutoFill Destination:=Range("AW2:AW" & Cells(Rows.Count, 1).End(xlUp).Row)Range("AX2").AutoFill Destination:=Range("AX2:AX" & Cells(Rows.Count, 1).End(xlUp).Row)Range("AY2").AutoFill Destination:=Range("AY2:AY" & Cells(Rows.Count, 1).End(xlUp).Row)Range("AZ2").AutoFill Destination:=Range("AZ2:AZ" & Cells(Rows.Count, 1).End(xlUp).Row)Range("BA2").AutoFill Destination:=Range("BA2:BA" & Cells(Rows.Count, 1).End(xlUp).Row)Range("BB2").AutoFill Destination:=Range("BB2:BB" & Cells(Rows.Count, 1).End(xlUp).Row)Range("BC2").AutoFill Destination:=Range("BC2:BC" & Cells(Rows.Count, 1).End(xlUp).Row)Dim strText As StringIf MsgBox("Sorting is done!", vbOKOnly, "Message Box") = vbOK Then Exit SubExit SubEnd Sub 



[解决办法]
lz想干嘛?

热点排行