Excel Workbook | ||||
---|---|---|---|---|
A | B | |||
1 | * | * | ||
2 | * | Green | ||
3 | * | Red | ||
4 | * | * | ||
Colour of cell |
Function ColorNumber(MyCell As Range)
ColorNumber = MyCell.Interior.ColorIndex
End Function
Function ColorName(mycell As Range)
Dim X As Long
X = mycell.Interior.ColorIndex
Select Case X
Case 1
ColorName = "BLACK"
Case 3
ColorName = "RED"
Case 14
ColorName = "GREEN"
Case Else
ColorName = "COLORNAME UNKNOWN"
End Select
End Function
JimPeter,
This =Get.Cell() function goes back years ago - MS created it obvioulsy to
satisfy certain requirements that couldn't be satified any other way (I guess).
The function has not been recognized since xl97 or before and there is no
2003, or 2007 equivalent. Can you shed further light on this function?
Thanks for your input!
Jim
I think the problem of not updating would be a problem for the code Misca has suggested as well as for my GET.CELL suggestion, since changing the colour of a cell will not trigger a recalculation of the sheet.Edit: This may not update as readily as you might like but I think this could be addressed with some vba code but, unless somebody else steps in, it will have to wait a while because I have to log out for now.