Identify cells in red

前端 未结 1 1291
傲寒
傲寒 2020-12-04 00:46

The title may be typically simple, but I did not get a solution yet even after researching over several forums on the net.

Let me explain the problem.

I have

相关标签:
1条回答
  • 2020-12-04 01:24

    Using the following works for me where I made a few cells in C default red.

    Dim ws As Worksheet
    Set ws = Sheets("sheet1")
    Dim i As Integer
    i = 1
    Do Until i = 11
        If ws.Range("C" & i).Interior.Color = RGB(255, 0, 0) Then
            debug.print "C" & i & "  is red!!"
        End If
    i = i + 1
    Loop
    

    enter image description here

    Edit:

    This also works using colorindex = 3 I think your problem is a combination of activecell and IIf

    0 讨论(0)
提交回复
热议问题