为sheet页中的测试用例添加序号,并排序。
Dim s As Worksheet
Set s = ThisWorkbook.activeSheet
If s.Index <= 4 Or s.Index = 11 Then
Exit Sub
End If
Dim i As Integer
Dim j As Integer
j = 1
Dim coloum As Integer
coloum = 4
If s.Index = 10 Then
coloum = 3
End If
For i = 3 To s.UsedRange.Rows.Count Step 1
Dim name As String
name = Trim(s.Cells(i, coloum).Text)
If name <> "" Then
s.Cells(i, 1).value = CStr(j)
j = j + 1
End If
Next
Dim s As Worksheet
Set s = ThisWorkbook.activeSheet
If s.Index <= 4 Or s.Index = 11 Then
Exit Sub
End If
Dim i As Integer
Dim j As Integer
j = 1
Dim coloum As Integer
coloum = 4
If s.Index = 10 Then
coloum = 3
End If
For i = 3 To s.UsedRange.Rows.Count Step 1
Dim name As String
name = Trim(s.Cells(i, coloum).Text)
If name <> "" Then
s.Cells(i, 1).value = CStr(j)
j = j + 1
End If
Next