簡體   English   中英

Excel 公式可以在colors的基礎上在Q,V,W,X,Y,Z列寫出具體的列

[英]Excel formula which can write specific column on the basis of colors in column Q,V,W,X,Y,Z

我有一個 excel 文件,它可能包含也可能不包含 Q、v、w、x、y、z 列中的顏色。 如果這些列中的任何一個包含顏色,我需要在“顏色”列中寫“是”,否則寫“否”,有人可以幫我嗎?

我可以實現這一目標的公式。

這可以通過創建一個宏來實現,這里是一個例子:

Sub YesMacro()
'
' Macro to write "Yes" if there is a fill color and "No" otherwise
' Applied to a selected range
'
Dim rng As Range: Set rng = Application.Selection
Dim c As Range
    For Each c In rng.Cells
        If (c.Interior.Color <> 16777215) Then
            c.FormulaR1C1 = "Yes"
        Else
            c.FormulaR1C1 = "No"
        End If
    Next c
End Sub

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM