Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
How do I write a macro or if-then statement to examine the font colour in a
cell and then return a value dependant on the colour? |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I,m not sure what you mean by return a value dependant on font colour but
determining the colour is easy enough. The code below returns the colourindex number of the active cell. Sub FontColor() MsgBox "The Font Color Index is " & ActiveCell.Font.ColorIndex End Sub Mike "sgdav" wrote: How do I write a macro or if-then statement to examine the font colour in a cell and then return a value dependant on the colour? |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
This function returns colorindices of the cell given as first argument,
depending on the second argument. If it's TRUE, then returns font colorindex, if FALSE, returns background colorindex. Function WhatColor(cella As Range, fontbackgr As Boolean) Application.Volatile If fontbackgr Then WhatColor = cella.Font.ColorIndex Else WhatColor = cella.Interior.ColorIndex End If End Function Regards, Stefi sgdav ezt *rta: How do I write a macro or if-then statement to examine the font colour in a cell and then return a value dependant on the colour? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Change all text one font size up with various font sizes used. | New Users to Excel | |||
Changed default font, previous font still shows when editing | Excel Discussion (Misc queries) | |||
Changed default font, previous font still shows when editing | Excel Discussion (Misc queries) | |||
change display font to actual selected font | Excel Discussion (Misc queries) | |||
Font changes | Charts and Charting in Excel |