求大神详细解释每一行代码的意思和作用

ub kk()
Dim oNewWorksheet, kj As Worksheet
Application.DisplayAlerts = False
For Each kj In ThisWorkbook.Worksheets
If kj.Name <> "数据" Then
kj.Delete
End If
Next
Application.DisplayAlerts = True
For i = 2 To Worksheets("数据").UsedRange.Rows.Count
If Application.WorksheetFunction.CountIf(Worksheets("数据").Range(Worksheets("数据").Cells(2, 1), Worksheets("数据").Cells(i, 1)), Worksheets("数据").Cells(i, 1).Value) = 1 Then
Set oNewWorksheet = Worksheets.Add
oNewWorksheet.Activate
ActiveSheet.Name = Worksheets("数据").Cells(i, 1).Value
Worksheets("数据").Rows("1:1").Copy
Rows("1:1").PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False

For b = 2 To Worksheets("数据").UsedRange.Rows.Count
If Worksheets("数据").Cells(b, 1).Value = Worksheets("数据").Cells(i, 1).Value Then
Worksheets("数据").Range(Worksheets("数据").Cells(b, 1), Worksheets("数据").Cells(b, 255)).Copy
ActiveSheet.Range("a65536").End(xlUp).Offset(1, 0).PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
End If
Next
End If
[A1].Select
Next
Application.CutCopyMode = False
Application.DisplayAlerts = True

End Sub

/**
* 这是一个计数器线程
*/
public class TimerThread extends Thread { //继承Tread类,TimerThread就是一个线程类
int n= 0; //初始计数为0
public void run(){
while(true){ //死循环
System.out.println(n); //打印计数
n++; //计数器自增长
try{
sleep(1000); //延时1秒钟
}
catch(InterruptedException e){
return;
}
}
}
public static void main(String[] args) {
TimerThread th = new TimerThread();
th.start(); //启动线程
}
}
温馨提示:答案为网友推荐,仅供参考
相似回答