+ Reply to Thread
Results 1 to 4 of 4

cell formatting

  1. #1
    Simon Jefford
    Guest

    cell formatting

    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

  2. #2
    Valued Forum Contributor
    Join Date
    03-25-2004
    Location
    Boston, MA US
    Posts
    1,094
    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

  3. #3
    Gary''s Student
    Guest

    RE: cell formatting

    Without 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("B1").Interior.ColorIndex = Range("A1").Value
    End Sub

    1. enter the macro
    2. put a number in A1 (like 36)
    3. run the macro


    The sample can easily be modified to handle alternative mappings and font
    colors as well.
    --
    Gary's Student


    "Simon Jefford" wrote:

    > 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


  4. #4
    Simon Jefford
    Guest

    Re: cell formatting

    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 "1" then format cell in column A background RED
    forground WHITE.

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

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

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

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

    Many 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: http://www.excelforum.com/member.php...fo&userid=7571
    > View this thread: http://www.excelforum.com/showthread...hreadid=504882
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1