close

I would like to format a cell based upon the contents of another cell. The
problem is that the determining cell has five variations - hence I cannot use
conditional formatting as this only allows three variations. In total, on a
worksheet, I have about 160 cells whose format I wish to change based upon
the contents of 160 associated cells on another worksheet. When changing the
format, I wish to change forground and background colours.
Any help would be much appreciated.
Thanks, Simon


Simon,

If you could describe your 5 variations and what you would like the
cell formatted as for each it would be helpful. Will each variation
produce a unique formatting? If multiple variations will result in the
same format, CF may work for you using formulas.
Steve--
SteveG
------------------------------------------------------------------------
SteveG's Profile: www.excelforum.com/member.php...foamp;userid=7571
View this thread: www.excelforum.com/showthread...hreadid=504882Without details on desired colors vs values here is a simple sample demo of
how to change the interior color of B1 based upon the value in A1:

Sub Macro1()
Range(quot;B1quot;).Interior.ColorIndex = Range(quot;A1quot;).Value
End Sub

1. enter the macro
2. put a number in A1 (like 36)
3. run the macroThe sample can easily be modified to handle alternative mappings and font
colors as well.
--
Gary's Studentquot;Simon Jeffordquot; wrote:

gt; I would like to format a cell based upon the contents of another cell. The
gt; problem is that the determining cell has five variations - hence I cannot use
gt; conditional formatting as this only allows three variations. In total, on a
gt; worksheet, I have about 160 cells whose format I wish to change based upon
gt; the contents of 160 associated cells on another worksheet. When changing the
gt; format, I wish to change forground and background colours.
gt; Any help would be much appreciated.
gt; Thanks, Simon

Steve

Thanks for the reply.
I have a column of entries in column C. All entries are integers from 1 to
5. I wish to format Column A based upon the entries in Column C.

If the entry in cell C is quot;1quot; then format cell in column A background RED
forground WHITE.

If the entry in cell C is quot;2quot; then format cell in column A background GREEN
forground BLACK.

If the entry in cell C is quot;3quot; then format cell in column A background YELLOW
forground BLACK.

If the entry in cell C is quot;4quot; then format cell in column A background BLUE
forground WHITE.

If the entry in cell C is quot;5quot; then format cell in column A background LIGHT
GREY forground BLACK.

Many thanks
Simon

gt;
gt; Simon,
gt;
gt; If you could describe your 5 variations and what you would like the
gt; cell formatted as for each it would be helpful. Will each variation
gt; produce a unique formatting? If multiple variations will result in the
gt; same format, CF may work for you using formulas.
gt;
gt;
gt;
gt; Steve
gt;
gt;
gt; --
gt; SteveG
gt; ------------------------------------------------------------------------
gt; SteveG's Profile: www.excelforum.com/member.php...foamp;userid=7571
gt; View this thread: www.excelforum.com/showthread...hreadid=504882
gt;
gt;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()