![](/img/trans.png)
[英]Excel Macro to change cell alignment, borders and wrap text if a value has been entered into another cell in the same row
[英]Change background color of more than one cell on the same row when another cell has a certain numeric value in Excel 2010
A B C D
1 Name 2009 2010 Total
2 Sam 400 600 1000
3 John 200 400 600
4 Eric 100 300 400
我正在處理一個簡單的列表(參見上面的示例),其中當 D 中的單元格值具有特定數字時,總計(D 列)和名稱(A 列)中的單元格背景顏色會發生變化(在簡單的交通燈系統中)值,即:
我使用 MS Excel 2010 使用條件格式序列來突出顯示 D 中的單元格。但是,我如何創建序列或代碼,以便同一行的 A 中的相應單元格以相同的方式着色? 例如,如果 D2 為綠色,那么我希望 A2 也為綠色嗎?
我該怎么做呢?
1.Select 單元格 A2
2.單擊條件格式>管理規則>新建規則>'使用公式確定要格式化的單元格'
3i)輸入公式=D2>=1000
並將格式設置為綠色填充
3ii)點擊New Rule>'Use a formula to determine which cells to format'並輸入=AND(D2<=999,D2>=500)
和選擇器格式為琥珀色填充
3iii)點擊New Rule>'Use a formula to determine which cells to format'並輸入=D2<500
並將格式設置為紅色填充
4.點擊確定
5.復制單元格A2並將格式粘貼到A3:Ax
6.重復上述步驟 1 - 5,但使用單元格 D2 而不是 A2
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.