Interior.Color返回错误的内部颜色

时间:2019-08-28 19:27:07

标签: excel

我正在尝试隐藏电子表格中具有白色背景的行。有些行也具有其他颜色背景。

For I = 63 To xRg.Count
    'Testing from the 63rd row using cells in column 'U'
        If xRg.Range("U" & I).Interior.Color = vbWhite Then
            xRg.Range("U" & I).EntireRow.Hidden = True
            'Application.ScreenUpdating = True
        Else
            xRg.Range("U" & I).EntireRow.Hidden = False
            'Application.ScreenUpdating = True
        End If
    Next 'i

    Application.ScreenUpdating = True
    MsgBox I

所有白色背景的行都必须根据“ U”列中单元格的单元格颜色进行隐藏。当内部颜色为绿色时,代码将返回白色内部颜色。该行不应该隐藏。

enter image description here

0 个答案:

没有答案
相关问题