+ Reply to Thread
Results 1 to 14 of 14

Cell Fill Colour

  1. #1
    Forum Contributor
    Join Date
    03-09-2007
    Location
    Australia
    MS-Off Ver
    Office 10
    Posts
    371

    Cell Fill Colour

    Hi,

    Need help to be able to fill a col with colour if the cells match.
    I have attached an example

    Assistance appreciated
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Cell Fill Colour

    Please Login or Register  to view this content.

  3. #3
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,749

    Re: Cell Fill Colour

    NOTE merges cells do not mormally work very well with formulas - and so the merge cell is being seens AS D3
    Select cells D8 to D16 then
    Put this
    =D8=DATE(YEAR($D$3),MONTH($D$3),DAY(D$6))
    as a conditional format formula and enter

    Now select D8:D16 and copy - select E8:Q16 and paste special > format

    see attached spreadsheet update

  4. #4
    Forum Contributor
    Join Date
    03-09-2007
    Location
    Australia
    MS-Off Ver
    Office 10
    Posts
    371

    Re: Cell Fill Colour

    Thanks for that but I have tried the code in the test sheet and cannot seem to get it to work
    are you are able to assist

  5. #5
    Forum Contributor
    Join Date
    03-09-2007
    Location
    Australia
    MS-Off Ver
    Office 10
    Posts
    371

    Re: Cell Fill Colour

    Perhaps I am not clear in what I am after
    If the date in col D is in the area D8 to q16 then only that date is to be filled
    e.g. 2/12/13 the col d5 to d 16 would be coloured blue
    The other date in the list is 9/12/13 so again L5 to 16 would be blue
    The Grey for the Sat and Sun to remain but as indicated only the dates nominated to be filled with a colour
    Hop that clarifies

  6. #6
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Cell Fill Colour

    Thats what the code I posted did when I tried it on the example you posted. Not sure what is different for you but it is probably to do with the date formatting.

  7. #7
    Forum Contributor
    Join Date
    03-09-2007
    Location
    Australia
    MS-Off Ver
    Office 10
    Posts
    371

    Re: Cell Fill Colour

    So you were able to get the code to highlight only the col with corresponding dates in col w

  8. #8
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Cell Fill Colour

    Yes. It highlighted in the blue colour the dates you had listed.

  9. #9
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,749

    Re: Cell Fill Colour

    So you were able to get the code to highlight only the col with corresponding dates in col w
    no I was matching with
    the month and year in D3 and the Days in row 6

    So did not use column W and how big will column W get - probably better to stay with yudlugar VBA/Macro solutions

  10. #10
    Forum Contributor
    Join Date
    03-09-2007
    Location
    Australia
    MS-Off Ver
    Office 10
    Posts
    371

    Re: Cell Fill Colour

    I cannot get the code to work on my example - attention yudlugar

  11. #11
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Cell Fill Colour

    I've been back and double checked, I copied the code back into the example workbook and run it, I got cell L6 highlighted in blue.

    As I said earlier, if this doesn't work the most obvious problem will be to do with date formatting on our machines. Maybe try running this macro and tell me what you get in cells A1 - A4
    Please Login or Register  to view this content.
    I'll then see if I can change my code to get it to work for you

  12. #12
    Forum Contributor
    Join Date
    03-09-2007
    Location
    Australia
    MS-Off Ver
    Office 10
    Posts
    371

    Re: Cell Fill Colour

    Sorry I could not get back to you earlier.
    No I cannot get it to work using either code

  13. #13
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Cell Fill Colour

    Try this regular Conditional formatting approach...

    1. highlight the range you want to apply the conditional formatting to
    2. on the home tab, styles, select CF
    3. select new rule, select use formula
    4. enter =ISNUMBER(VLOOKUP($D$3+D$6-1,$AL$6:$AL$11,1,0)) format fill the color you want
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  14. #14
    Forum Contributor
    Join Date
    03-09-2007
    Location
    Australia
    MS-Off Ver
    Office 10
    Posts
    371

    Re: Cell Fill Colour

    Many thanks that worked just fine
    Appreciate the help

+ 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