识别室内亮点 [英] recognize a interior highlight

查看:26
本文介绍了识别室内亮点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,所以我试图识别深蓝色文本2加亮60%的所有内容,对于在其范围内为真的每个值,我想在单元格右边添加2个空格=1.我有以下内容代码,有什么想法吗?

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?

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

推荐答案

点击:
工具栏上的填充颜色图标,然后选择您的颜色,然后
子菜单和自定义"标签
中的更多颜色现在,您可以看到构成所选择颜色的RGB(红色,绿色,蓝色)对象的三个值
与其像使用所有参数一样使用简单,而是将 RGB 对象与这三个值一起使用

Click:
Fill Color icon on the tool bar, and select your color then
More Colors from the submenu and custom tab
now , you can see the three values that make up an RGB(Red, Green, Blue) object for the color you chose
Instead of using all the arguments like you have done - simply use the RGB object with the three values

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

这篇关于识别室内亮点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆