General discussion

Locked

Dynamic setting of cell's color

By benkindagozo ·
How can I dynamically set cell's color in Excel?
It seems that color is not considered as a property with built-in functions to handle it.

Any advice?
Ben

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Dynamic setting of cell's color

by mark In reply to Dynamic setting of cell's ...

It depends what you mean by dynamically in this case, Ben. Typically, you might want the color of a cell or the font to change based on a set of criteria (for example, if cell A3 is greater than the value in B5, then show cell C5 in red.)

This iscalled conditional formatting. Go to the "format" menu, then "conditional formatting". You can then choose an 'argument' based on how you want the colour or appearance of cells or text to change under given circumstances. The "Border" tab under conditional formatting typically contains the features that will allow you to change the cell colour.

Regards

Collapse -

Dynamic setting of cell's color

by benkindagozo In reply to Dynamic setting of cell's ...

The question was auto-closed by TechRepublic

Collapse -

Dynamic setting of cell's color

by wjhunt In reply to Dynamic setting of cell's ...

Ben,
Here is some code that sets a cell's color:
Range("D5").Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
You can wrap your conditionals around it...

Collapse -

Dynamic setting of cell's color

by benkindagozo In reply to Dynamic setting of cell's ...

The question was auto-closed by TechRepublic

Collapse -

Dynamic setting of cell's color

by benkindagozo In reply to Dynamic setting of cell's ...

This question was auto closed due to inactivity

Back to Web Development Forum
5 total posts (Page 1 of 1)  

Related Discussions

Software Forums