Hi nativeplanter
OK. Open just your workbook in Excel and press Alt + F11. This will open the VBE (Visual Basic Environment), which is where you can enter / edit your code (macros). Go to Insert > Module and in the empty pane that opens up, copy the code from below :
Function CellColour(InRange As Range)
Application.Volatile True
CellColour = InRange(1, 1).Interior.ColorIndex
End Function
Function IsBold(InRange As Range)
Application.Volatile True
IsBold = InRange(1, 1).Font.Bold
End Function
You can now go to File > Close and Return to Microsoft Excel.
This contains two custom functions : =CellColour() and =IsBold() . CellColour will return the ColorIndex number of the colour, IsBold will return a boolean (True / False) value.
I was going to give instructions on its use now, but I think an example workbook would serve better, so have a look at the attached.
One more thing : nothing to do with me (it's a Microsoft thing), but the formulae will only update on the next recalc - a recalc isn't performed when you change formatting. To force a recalc, just press F9.
HTH
DominicB
Bookmarks