+ Reply to Thread
Results 1 to 8 of 8

Change cell color in a cell formula "without conditional"

  1. #1
    Registered User
    Join Date
    02-22-2013
    Location
    SF Bay Area, California
    MS-Off Ver
    Excel 2007
    Posts
    4

    Change cell color in a cell formula "without conditional"

    Hello All
    I have come to you to find out if there are any Real hardcore Excel Geeks here!!!!
    My situation is, I want to change the color of a cell based on the result of a logic statement. I have no problem with the Logic statement and, I know that everyone recommends using “Conditional”, I just like the personal touch and feel.
    So I ask that only replies that specifically answer the question of,
    What is the code needed to change cell color (font, size, font color, … ) in a cell formula "without using conditional formatting".
    I have search the web awhile ago and had the code, but that Lap Top was stolen.http://www.excelforum.com/images/smilies/mad.gif

    Thanking you in advance.
    http://www.excelforum.com/images/smilies/cool.gif

  2. #2
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Change cell color in a cell formula "without conditional"

    I don't have a block of code/instructions like that readily available. What I recommend is that you use 'Record Macro', make the cell format changes you want, stop recording, and then look at the code that was generated.
    Pauley
    --------
    If I helped with your issue, I'd appreciate a rep bump (hit the '*' icon to the bottom left of this post).

  3. #3
    Registered User
    Join Date
    02-22-2013
    Location
    SF Bay Area, California
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Change cell color in a cell formula "without conditional"

    Thanks Pauley
    The issue is that the format for cell formulas are different than in a macro, been there done that.
    Thanks anyway for the try.
    Conetopper

  4. #4
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Re: Change cell color in a cell formula "without conditional"

    you can use instructions like this

    Please Login or Register  to view this content.
    Regards
    Sean

    Please add to my reputation if you think i helped
    (click on the star below the post)
    Mark threads as "Solved" if you have your answer
    (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code:
    [code] Your code here [code]
    Please supply a workbook containing example Data:
    It makes its easier to answer your problem & saves time!

  5. #5
    Registered User
    Join Date
    02-22-2013
    Location
    SF Bay Area, California
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Change cell color in a cell formula "without conditional"

    Thanks Sean
    Close but no cigar, I need it in the format of a Cell Formula
    If(x=2, -change cell to color red-, -change cell to color white-)
    Something like that.
    Of course I may not know how to migrate your code into the Cell Formula format, if I am missing that nut, please help.
    Thanks for the try.
    Conetopper

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Change cell color in a cell formula "without conditional"

    What is the result of your logic statement? How many different results are there and what would you want to color or font to be in each instance?

    Why are you against the easier solution of using Conditional Formatting?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  7. #7
    Registered User
    Join Date
    02-22-2013
    Location
    SF Bay Area, California
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Change cell color in a cell formula "without conditional"

    Thanks ChemistB
    The result of me logic statement is not in question only the ability to change whatever I wish when a result is given. The basic formula was given in my first past and here again,
    Well aBrain fart, it looks like my Code did not make it to my first post so lets try this again

    Code =If(x=2(-change color to Red and Font to 18-,if(x=3,change color to blue and Font to 10, change color to white and Font to 12-)) /code

    We can start with the current cell and later how to control multiple cells.

    To answer why, will it is just part of my nature to dissect whatever is my passion at the time and this is it. I have no ill feelings using Conditional, just I want to learn this method of control.
    Thanks.
    Conetopper

  8. #8
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Re: Change cell color in a cell formula "without conditional"

    I dont think it is possible to do what you want with excel.
    I believe the only way is with vba or you could create a function and then use that in your if statement.

    ie
    =if(ConditionalColor(A1,"interior")="color",C1,"")

    see

    http://vbaexpress.com/kb/getarticle.php?kb_id=190

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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