[英]Conditional Formatting for background color and text based another cell value
[英]Automatically copy the background color of a cell which is using Conditional Formatting, to another cell
取決於條件格式的顏色可以通過Range.DisplayFormat 屬性獲得。
因此,您可以使用以下代碼滿足您的要求:
Sub copyConditionalColors()
Dim r As Range
Dim c As Range
Set r = ActiveSheet.Range("B1:B5")
For Each c In r
c.Offset(0, -1).Interior.Color = c.DisplayFormat.Interior.Color
Next
End Sub
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.