+ Reply to Thread
Results 1 to 5 of 5

Change cell color dependand on cell value

  1. #1
    Registered User
    Join Date
    06-06-2007
    Posts
    9

    Question Change cell color dependand on cell value

    Hi everyone.

    I am pretty new at Excel programming, so please bear with me on this easy question...

    I have a cell where the user inputs a value between 1 and 5.
    If its "1", make cell background light red and text color dark red
    If its "2", make cell background light yellow and text color dark yellow
    If its "3", make cell background light green and text color dark green
    etc..

    How do I do this?

  2. #2
    Forum Contributor
    Join Date
    01-10-2006
    Location
    Ahmedabad, India
    MS-Off Ver
    Office 2000
    Posts
    346
    Use Conditional Formatting
    Select the cell you are interested in. On menu click Format>Conditional Formatting and then select the options you want. It will guide you through with easy steps.

    A V Veerkar

  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try

    Change range ("A:A") to your range.

    Change colour index numbers as required. Link should help

    http://www.mvps.org/dmcritchie/excel/colors.htm

    Right click sheet name and paste in code

    http://www.contextures.com/xlvba01.html#Worksheet


    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  4. #4
    Registered User
    Join Date
    06-06-2007
    Posts
    9
    Thanks VBA Noob - that was just what I needed.

    It works great and looks really cool too :-)

    Perhaps you should change name to VBA L33T ?

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    DonTron,

    Glad it helped. Thx for the feedback and the name suggestion.

    VBA Noob

+ 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