专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > VB Dotnet

testing,该怎么解决

发布时间:2011-06-23 16:03:18 文章来源:www.iduyao.cn 采编人员:星星草
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 = xlAutomatic
End With

'***Delete Columns***
Columns("A:A").Select
Selection.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.Delete
Next

'***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").Select
ActiveCell = ActiveCell & "Block no"
Range("AT1").Select
ActiveCell = ActiveCell & "Ingot No."
Range("AU1").Select
ActiveCell = ActiveCell & "Fur ID"
Range("AV1").Select
ActiveCell = ActiveCell & "Position"
Range("AW1").Select
ActiveCell = ActiveCell & "Fur Run"
Range("AX1").Select
ActiveCell = ActiveCell & "Saw-Mark%"
Range("AY1").Select
ActiveCell = ActiveCell & "DI%"
Range("AZ1").Select
ActiveCell = ActiveCell & "NCVD%"
Range("BA1").Select
ActiveCell = ActiveCell & "A-Wafer"
Range("BB1").Select
ActiveCell = ActiveCell & "A5"
Range("BC1").Select
ActiveCell = 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 String
If MsgBox("Sorting is done!", vbOKOnly, "Message Box") = vbOK Then Exit Sub

Exit Sub
End Sub

友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: