+ Reply to Thread
Results 1 to 10 of 10

"Locking" a Cell Fill Color

  1. #1
    Registered User
    Join Date
    09-12-2012
    Location
    Washington, DC
    MS-Off Ver
    Excel 2010
    Posts
    14

    "Locking" a Cell Fill Color

    I have tried to figure this out but to no avail. How do you "lock in" a cell color so that if you want to change cell colors later, that color won't change. In other words, one cell color has a priority over another one (e.g. yellow over grey or "no fill").

    Here's an example: I want specific cells in column H to always be yellow. Let's say the range is H5:H800. But I have a need to change row colors based on other criteria, so I want to be able to alternate between grey and white for example with the row colors. So let's say I want to change rows 60-70, 110-145, and 155-157 to be all grey in all columns EXCEPT the column H that I want to stay yellow no matter what.

    Also, I looked into conditional formatting but the thing is that my decision to color the cells is not based on a specific value or a formula. For instance, let's say I have hundreds of invoices with many line items in each invoice and that I want to list the line items row by row in Excel. I'd like to alternate the color "white-grey-white" in the rows so that it's easy for me to see when one invoice data ends and the other begins. That is easy to do manually as I go along and add more data to my sheet except that when I change the row colors based on what "invoice data" it is, the column H with the color yellow gets changed too (and I'd like to keep that column yellow because it indicates cells where I have to plug in data). Hopefully somebody can follow what I'm saying.

  2. #2
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    633

    Re: "Locking" a Cell Fill Color

    you can simply add a conditional format to column H:

    use this formula then apply in column H:

    =OR(H1="",H1<>"")

    this way even if you change the row color. Column H will remain yellow
    If I've helped U pls click on d *Add Reputation

  3. #3
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: "Locking" a Cell Fill Color

    Hi,

    You could use a conditional format with the formula =COLUMN()=7 and yellow fill, with 'Stop if True' and make sure it's the first rule to be evaluated. See the attached sheet for this working.
    CF to _ignore_ a column for other CF.xlsx

    Regards,
    Aardigspook

    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark Thread as Solved'.
    You don't need to give me rep if I helped, but thanks are appreciated.

  4. #4
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.97 for Mac MS 365
    Posts
    8,701

    Re: "Locking" a Cell Fill Color

    I've done that using regular fill and conditional formatting. I highlighted the rows and color filled them. Then in one column I used conditional formatting to fill certain cells based on criteria and that overrides the row color. I would assume you could do something like that where you just use the criteria where cells in col H aren't blank as the criteria?

    EDIT: wow look how long that took me to type that in using an iPad, when I began no replies and by the time I hit post 2 replies.
    Last edited by Sam Capricci; 08-25-2015 at 05:56 PM.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  5. #5
    Registered User
    Join Date
    09-12-2012
    Location
    Washington, DC
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: "Locking" a Cell Fill Color

    Thank you so much for the quick replies, everyone! This forum and the people here are truly remarkable!

    I must say that I haven't used conditional formatting before so I'm having trouble figuring this out (how to create a new rule the way Aardigspook did), but it must be simple so I'll try to figure this out.

  6. #6
    Registered User
    Join Date
    09-12-2012
    Location
    Washington, DC
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: "Locking" a Cell Fill Color

    I have put in the formula =COLUMN()=7 and yellow fill, with 'Stop if True' (and it's the first formula to be evaluated), but I'm not sure what's going on with the "cell value =4, cell value =2" stuff. Sorry, I'm a complete beginner when it comes to conditional formatting.

  7. #7
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: "Locking" a Cell Fill Color

    Hi,

    Sorry, I should have explained better - the other conditional formatting in the file I provided was just there to show how the =Column()=7 formula took priority over the other conditions. To apply this to your own file, apply any other conditional formats you want (including the alternate rows - which you can do automatically - see below). Then go to Conditional Formatting, click 'New Rule' and choose 'Use a formula to determine which cells to format'. Type =COLUMN()=7 into the formula box and select the format you want using the 'Format' button, then click 'OK'

    Now click Conditional Formatting again and this time choose 'Manage Rules'. Select the rule you just made and put $G1:$G100 into the 'Applies to' box (make the range as big as you need it to be), then ensure that 'Stop If True' is selected. If you can't see the rule, you've probably clicked a cell outside the range it applies to - select 'This Worksheet' in the drop-down list at the top.

    Highlighting alternate rows automatically:
    Conditional Formatting → New Rule → Use a Formula to determine which cells to format. Put this formula in =MOD(ROW(),2) and select the shading you want for the alternate rows.


    Hope that helps and sorry for the earlier confusion.

    Regards,
    Aardigspook

    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark Thread as Solved'.
    You don't need to give me rep if I helped, but thanks are appreciated.

  8. #8
    Registered User
    Join Date
    09-12-2012
    Location
    Washington, DC
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: "Locking" a Cell Fill Color

    Thank you! I kind of realized you were just showing how the priority works, but then I was a fool and didn't select the correct range for the rule. Now it works perfectly and I've learned a little bit about conditional formatting in the process! Thanks again!

  9. #9
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: "Locking" a Cell Fill Color

    You're welcome - glad I could help.

    Regards,
    Aardigspook

    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark Thread as Solved'.
    You don't need to give me rep if I helped, but thanks are appreciated.

  10. #10
    Registered User
    Join Date
    12-27-2016
    Location
    amravati, maharashtra
    MS-Off Ver
    10 and 13
    Posts
    5

    Re: "Locking" a Cell Fill Color

    Re: "Locking" a Cell Fill Color

    lock cell colour but copy paste then do not change background color and font color

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 06-05-2015, 01:55 PM
  2. [SOLVED] Formula Needed to fill multiple cells with "No" when the word "No" is entered into a cell
    By excelteam777 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-09-2013, 05:36 PM
  3. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  4. "Hard code" the fill color of a cell
    By mroberts in forum Excel General
    Replies: 1
    Last Post: 12-18-2012, 01:20 PM
  5. "If" and Syntax to change font and fill (interior) color based on cell value
    By jdfjab in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-17-2012, 10:29 AM
  6. [SOLVED] Incorporating Cell color fill in an "if" logical function?
    By George_Sky in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-18-2006, 03:15 PM
  7. [SOLVED] set "value if true" to "fill cell with color"
    By Feeta in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-23-2005, 04:05 AM

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