+ Reply to Thread
Results 1 to 6 of 6

Excel 2003 VBA or conditional formatting. Date in one cell needs to format remote cell

  1. #1
    Registered User
    Join Date
    03-13-2012
    Location
    Moscow
    MS-Off Ver
    Excel 2003
    Posts
    6

    Excel 2003 VBA or conditional formatting. Date in one cell needs to format remote cell

    Hello everybody,

    I have looked hard in the forum for an answer to this, but nothing gets close enough for me to be able to sort the problem on my own. Below is an example of a annual roster on which I'm working. I've only shown a small area, for brevity.

    The coloured areas are conditionally formatted. Ivory shows Away, green is for Work, pale blue is a day on which a shift-change may occur, and TD is a Transition Day. The mustard colour is the "base", so I don't need to use up a CF option for those cell-values.

    What I'd like to do is collect the date from a cell outside the formatted area, rows 12 and 13 in the extract, and then colour the relevant cell red, as per the example. ie CD has an Expiry date of the 2nd Mar, therefore fill the cell corresponding to the relevant day, F7, in red, I drew a red border round it to show what I mean.

    Is it possible to do this with a Conditional Formatting formula, preferable, or is VBA the answer?

    Thanks in advance, and any help gratefully accepted
    Attached Files Attached Files
    Last edited by Duffgen; 06-26-2013 at 03:37 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    11-15-2010
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2003
    Posts
    538

    Re: Excel 2003 VBA or conditional formatting. Date in one cell needs to format remote cell

    What you want to do is click the first thing in the conditional formatting box, changing
    Cell value is
    to
    Formula is
    and in the "formula box" that appears, type an equal sign and a formula that is either true or false, and have the formula refer to cells somewhere else in the worksheet. For example in F7 you could enter as the conditional format formula, while assuming you always have month in column L (1,1,1,2,2,2,3,3,3, etc.),
    =$L7*100+F$1>100*$D$12+$E$12
    As you see, you would have to construct logic that compares the current cell F7 to the date of C12. I simply assumed you would compare (100 times month) + day for a simple comparison, just to show you how it would work.

    Then you could use the pattern or whatever in conditional formatting based on the formula being true.

    By the way, a defined range name is VERY preferable to $D$12 in the example above.

    Does this give you ideas?
    Chip, if you can read this, you're STILL making the world a better place with your immeasurably valuable gifts. Every week, you continue to help me (and untold numbers of others) tremendously. Practically no alternative outlets can match your effectiveness, even over the vast number of topics you demystify and empower usage of. You were, and still are, amazing.

  3. #3
    Registered User
    Join Date
    03-13-2012
    Location
    Moscow
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Excel 2003 VBA or conditional formatting. Date in one cell needs to format remote cell

    Hello,

    I'll give it a go over the next couple of days, and report on my results.

    I knew it wasn't going to be too Herculean a task, I just needed a pointer

    Thank you kindly for taking the time to help!

  4. #4
    Registered User
    Join Date
    03-13-2012
    Location
    Moscow
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Excel 2003 VBA or conditional formatting. Date in one cell needs to format remote cell

    Hi Opressed1,

    I've had a go at using your formula, but am not making much headway.

    I understand that an assumption is made about the month being in column "L", but I'm unsure why you'd check it more than just the once, when the table is altered by inputting the expiry date, to highlight that date in the roster.

    I've used =((TEXT(B$1,"dd"))=(TEXT($C$13,"DD"))) to extract the date number, to compare the expiry date of CD with the date at the top of the table, and although it works to highlight the relevant cell, it also stops the rest of the CF from working in that row!

    Any more thoughts?

  5. #5
    Registered User
    Join Date
    04-20-2013
    Location
    Woking, England
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    34

    Re: Excel 2003 VBA or conditional formatting. Date in one cell needs to format remote cell

    Hi

    Identical post :-
    http://www.mrexcel.com/forum/excel-q...ormatting.html

    If you cross-post please quote the post in your thread on the other forum.

    Thank you.

  6. #6
    Registered User
    Join Date
    04-20-2013
    Location
    Woking, England
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    34

    Re: Excel 2003 VBA or conditional formatting. Date in one cell needs to format remote cell

    Hi

    Solution provided on the other thread :-
    http://www.mrexcel.com/forum/excel-q...ml#post3510018

+ 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