- 帖子
- 976
- 主題
- 7
- 精華
- 0
- 積分
- 1018
- 點名
- 0
- 作業系統
- Win10
- 軟體版本
- Office 2016
- 閱讀權限
- 50
- 性別
- 男
- 註冊時間
- 2013-4-19
- 最後登錄
- 2026-5-26
|
回復 1# Andrewfat
請測試看看,謝謝
Sub test()
Dim Arr, xU
With Cells.Font
.ColorIndex = 1
.Bold = False
End With
Arr = Range("e6").CurrentRegion
Set xU = [e6]
For i = 2 To UBound(Arr) Step 2
For j = 2 To UBound(Arr, 2)
If Arr(i, j) > Arr(3, 1) Then
Set xU = Union(Cells(i + 5, j + 4).Resize(2, 1), xU)
End If
Next j
Next i
With xU.Font
.ColorIndex = 3
.Bold = True
End With
[e6].Interior.ColorIndex = xlNone
End Sub |
|