Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Programming

Journal pocra's Journal: Variable Greyscale Highlighting in Excel 1

Sub Bumplight()
'15 minute programming ii
'VBA(Excel) Macro for virtual bumpmapping for selected values
'by Pocra 23 Dec 2002
Dim aw As Range
Dim ad As Range
Set aw=Selection 'Range("C3:V18")
mn=Application.WorksheetFunction.Min(aw)
mx=Application.WorksheetFunction.Max(aw)
mm=mx-mn
If mm<>0 Then
For s=3 To 24
ActiveWorkbook.Colors(s)=RGB(255-(s*10),(255-Int(s*10)),255-(s*10))
Next
For Each ad In aw
tt=Int(((ad.Value-mn)/mm)*21)
ad.Interior.ColorIndex=tt+3
If tt>13 Then ad.Font.ColorIndex=2 Else ad.Font.ColorIndex=1
Next
Else
MsgBox("Gonnae no do that? Select some numbers, why don't you.")
End If
End Sub
This discussion has been archived. No new comments can be posted.

Variable Greyscale Highlighting in Excel

Comments Filter:

Thus spake the master programmer: "After three days without programming, life becomes meaningless." -- Geoffrey James, "The Tao of Programming"

Working...