sebenarnya sudah saya email langsung ke bung "t0f1q", idenya diperoleh dari..
http://priatna.or.id/2007/11/30/excel-macro-dan-conditional-formatting/
saya modif di bagian warna merah, pertama buat pada baris pertama
A1 B1 C1
1 119 TRUE
A1 dan B1 berisi : =RANDBETWEEN(-1;20) ....[dicopy aja ya]
C1 berisi : =IF(A2+B2>20;TRUE;FALSE)
-Nah terus perosotin ke bawah eh.. maksudnya di copy blok sampai baris ke 10
..[ misalnya, sampai berapa juga terserah]
- Tekan tombol Alt + F11 di papan ketik. Di jendela Microsoft Visual Basic
bagian VBAProject klik-ganda ThisWorkbook. Di bagian sebelah kanan yang
terbuka, copy-paste kode berikut ini.
Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
nCol = 1
nRow = 1
Cells.Font.ColorIndex = 0
While Not IsEmpty(Cells(nRow, nCol))
While Not IsEmpty(Cells(nRow, nCol))
Cells(nRow, nCol).Select
If Selection.Value = False Then
Selection.Font.ColorIndex = 3
End If
If Selection.Value = True Then
Selection.Font.ColorIndex = 5
End If
nCol = nCol + 1
Wend
nCol = 1
nRow = nRow + 1
Wend
End Sub
- kembali ke lembar kerja,cobalah tekan tombol F9 berulang-ulang untuk hasil
yang berbeda.
- semoga membantu..