Home |
Search |
Today's Posts |
#10
![]() |
|||
|
|||
![]()
Yes (with slight correction):
Public Function ColorCell(MyCell As Range, Color, Optional Message) As Variant MyCell.Interior.ColorIndex = Color If IsEmpty(Message) Then MyCell = "" Else MyCell = Message End Function Sub Color_red() ' ' Color_red Macro ' Set cell color to red ' ' Dim x As Variant x = ColorCell(Range("a2:a7"), 3, "This should be red") End Sub "Ola" wrote: Is it possible to make this work? Public Function ColorCell(MyCell As Range, Color, Optional Message) As Variant MyCell.Interior.ColorIndex = Color If IsEmpty(Message) Then ColorCell = "" Else ColorCell = Message End Function Ola |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Change cell back color on click | Excel Discussion (Misc queries) | |||
Color change in cell when > 49.99 | Excel Discussion (Misc queries) | |||
Current Cell Color | Excel Worksheet Functions | |||
cell color shading | Excel Discussion (Misc queries) | |||
GET.CELL | Excel Worksheet Functions |