|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
'猜一个
Option Explicit
Sub test()
Dim arr, i, j, k, kk
arr = [a1].CurrentRegion.Offset(1).Value
For i = 1 To UBound(arr, 1) - 1
For j = i To UBound(arr, 1) - 1
If arr(j, 2) <> arr(j + 1, 2) Then
For k = i To j
If arr(k, 3) <> "F" Then
arr(k, 3) = "T"
Else
For kk = k + 1 To j: arr(kk, 3) = vbNullString: Next
Exit For
End If
Next
i = j: Exit For
End If
Next j, i
[a2].Resize(UBound(arr, 1) - 1, UBound(arr, 2)) = arr
End Sub |
评分
-
1
查看全部评分
-
|