I have one excel file, which may or may not contain colours in column Q,v,w,x,y,z. if any of these column contain colour I need to write "Yes" else "No" in "Colour" column, could someone help me here please?
formula by which I can achieve this.
That could be achieved by creating a Macro, here is an example:
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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.