+ Reply to Thread
Results 1 to 6 of 6

Change Cell Color based on Day of the week

  1. #1
    Registered User
    Join Date
    04-20-2008
    Location
    New York City
    MS-Off Ver
    2003
    Posts
    38

    Change Cell Color based on Day of the week

    On the spreadsheet, I have the date displayed on cell K1 "Monday, June 07, 2010". I am trying to write VBA to scan K1 for the day of the week i.e Monday, Tuesday etc. Afterwards I want certain cells in the sheet to change color depending on which day of the week it is. For example, lets say when the day is "Tuesday, June 08, 2010" then cells B40:E40 and B42:E42 would change color.

    Please Login or Register  to view this content.
    Last edited by evenings; 06-07-2010 at 03:19 PM. Reason: Wrong code. Needed fix

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Change Cell Color based on Day of the week

    Is the date a string or entered as a date & formatted as a day?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    04-20-2008
    Location
    New York City
    MS-Off Ver
    2003
    Posts
    38

    Re: Change Cell Color based on Day of the week

    date is entered as 06/07/2010 and then displayed as Monday, June 07 2010

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Change Cell Color based on Day of the week

    Use the WeekDay Function

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Change Cell Color based on Day of the week

    Try this,
    Please Login or Register  to view this content.
    Last edited by royUK; 06-07-2010 at 01:54 PM.

  6. #6
    Registered User
    Join Date
    04-20-2008
    Location
    New York City
    MS-Off Ver
    2003
    Posts
    38

    Re: Change Cell Color based on Day of the week

    Quote Originally Posted by royUK View Post
    Try this,
    Please Login or Register  to view this content.
    Ok, I messed up on the original posting. I just edited it. What I want the code to do is change the cell color for each day of the week. Mondays is red Tuesday is Blue.. etc.

+ 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