简体   繁体   English

计算表中有多少PINK或BLUE A值

[英]Count how many PINK or BLUE A values are on the table

在此处输入图片说明

I would like to know how many blue A are under SONY and how many pink A are under Sony as well . 我想知道索尼下有多少蓝色A,索尼下有多少粉红A。 The same situation for Wii Wii的情况相同

I'm having issues combining INDEX+ COUNTIF because i do not know how include the fontcolor on the formula 我在合并INDEX + COUNTIF时遇到问题,因为我不知道如何在公式中包含fontcolor

Using the Font.Color property in Excel VBA, you can loop through the cells in a range and check if they match a color property. 使用Excel VBA中的Font.Color属性 ,可以遍历范围中的单元格并检查它们是否与color属性匹配。

Here's an example to get you started. 这是一个入门的示例。 It checks cells in the first four rows in the first column, and sees if they are colored RGB(255, 0, 0), which is red: 它检查第一列的前四行中的单元格,并查看它们是否为RGB(255,0,0)着色,该颜色为红色:

For i = 1 To 4
    If Cells(i, 1).Font.Color = RGB(255, 0, 0) Then
        'code to execute here if the cell has
        'font with red coloring
    End If
Next

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

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