简体   繁体   English

识别室内亮点

[英]recognize a interior highlight

Okay so I´m trying to recognize everything highlighted with the Dark Blue text 2 lighter 60% and for each value where its true in my range I want to make the cell 2 spaces to the right = 1. I have the below code, any ideas? 好吧,所以我试图识别深蓝色文本2亮60%突出显示的所有内容,对于在其范围内为真的每个值,我都希望将单元格右边的2个空格=1。我有以下代码,想法?

Sub findcolor()
Dim cl As Range

For Each cl In Workbooks("Report").Worksheets("sheet1").Range("A1:B10")
 If cl.Interior.Pattern = xlSolid And cl.Interior.PatternColorIndex = xlAutomatic And cl.Interior.ThemeColor = xlThemeColorLight2 And cl.Interior.TintAndShade = 0.599993896298105 And cl.Interior.PatternTintAndShade = 0 Then
        cl.Offset(0, 2).Value = "1"
    End If
Next cl
End Sub

Click: 点击:
Fill Color icon on the tool bar, and select your color then 在工具栏上Fill Color图标,然后选择颜色
More Colors from the submenu and custom tab 子菜单和“自定义”选项卡中的More Colors
now , you can see the three values that make up an RGB(Red, Green, Blue) object for the color you chose 现在,您可以看到组成您所选择颜色的RGB(红色,绿色,蓝色)对象的三个值
Instead of using all the arguments like you have done - simply use the RGB object with the three values 无需像使用完一样使用所有参数- 只需RGB对象与这三个值一起使用

Sub findcolor()
    Dim cl As Range
    For Each cl In Worksheets("Sheet1").Range("A1:B10")
        If cl.Interior.Color = RGB(141, 180, 226) Then
            cl.Offset(0, 2).Value = "1"
        End If
    Next cl
End Sub

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM