返回列表 上一主題 發帖

請指導如何選取所有符合格式化條件的儲存格

回復 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

TOP

        靜思自在 : 得理要饒人,理直要氣和。
返回列表 上一主題