Execl 設定格式化條件??

2008-07-11 1:52 am
EXCEL 懊惱問題~10分
如果想係一直行裡面入一個日子,但如果已經係昨日日子(即過了期就變成其他顏色咁等........??
其他末到期日子依然保持黑色...
How Can I Do??


EXECL 有冇呢個功能?
THANKS!!!

回答 (3)

2008-07-13 12:24 am
✔ 最佳答案
假設你的工作表是 Sheet1, 欄是 A, 列是1至10

入到 Sheet1 按 Alt+F11

輸入:

Private Sub Worksheet_Activate()
Dim i As Integer
Dim firstRow As Integer
Dim lastRow As Integer
Dim column As String * 1

firstRow = 1 '第一列數
lastRow = 10 '最後列數
column = "A" '欄名

For i = firstRow To lastRow
If IsDate(Range(column & i).Value) = True Then
If Range(column & i).Value < Date Then
Range(column & i).Font.ColorIndex = 3
Else
Range(column & i).Font.ColorIndex = 1
End If
End If
Next
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
Call Worksheet_Activate
End Sub


希望可以幫你
2008-07-11 3:53 am
In addition....

If you want to use 'current date' as the guide, then you can put in =today() in one cell, and reference to this cell when doing conditional formatting.
2008-07-11 2:08 am
首先係highlight你要做嘢果行

格式>設定格式化條件

第一格揀儲存格的值
中間果格揀小於
第三格係側邊有個掣,之後揀你要少於幾多等於過期
跟住禁下面格式掣揀顏色
再禁確定就搞掂喇


收錄日期: 2021-04-23 23:10:35
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20080710000051KK02194

檢視 Wayback Machine 備份