+ Reply to Thread
Results 1 to 3 of 3

Locate Saturday and Sunday

  1. #1
    Forum Contributor
    Join Date
    04-20-2011
    Location
    New York, New York
    MS-Off Ver
    Excel 2010
    Posts
    160

    Locate Saturday and Sunday

    Hello,

    I have a spreadsheet that contains date values in cells found within Columns L and M. The first row is reserved for row titles so the dates values actually begin in row 2. I want to create a macro that can highlight cells (fill the cell with color yellow) if the date value is a Saturday or Sunday.

    The number of rows change from time to time so I would need a solution that can account for this (something along the lines of L2 to last row in Column M).

    Please let me know if something is not clear and thank you very much for your time and attention.

    Lastly, I have a similar post like this one on Mr. Excel. I want to reach a broader audience therefore I am hoping someone in this forum can help me with a VBA solution. Here is the link to the Mr. Excel Post:

    http://www.mrexcel.com/forum/excel-q...ay-sunday.html

    - BC

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,412

    Re: Locate Saturday and Sunday

    You can use conditional formatting for this - no need for any VBA code. With cell from L2 down selected, click on Conditional Formatting | New Rule | Use a Formula ..., and then enter this formula in the dialogue box:

    =WEEKDAY(L2,2)>5

    Then click the Format button | Fill tab and choose yellow, then OK your way out.

    Hope this helps.

    Pete

  3. #3
    Forum Contributor
    Join Date
    04-20-2011
    Location
    New York, New York
    MS-Off Ver
    Excel 2010
    Posts
    160

    Re: Locate Saturday and Sunday

    Pete_UK,

    thank you for your response first of all. The solution that I am going for will require a an Add-in. I say this because an individual will not be using the same workbook. I want to give the user the ability to use any workbook they want and then import the data that contains dates.

    The idea is that the users can then click on the add-in and it will do what I described in my post.

    - BC

+ 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. Saturday, Sunday or Holiday BY-PASS
    By GPErtel in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-19-2013, 08:26 PM
  2. [SOLVED] How do i draw out Saturday and Sunday when using time diff
    By zalora in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-28-2013, 05:32 AM
  3. Function to Ignore Saturday and Sunday
    By kamalthakur in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-08-2008, 11:34 AM
  4. identifying saturday and sunday in a date
    By mdub72 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-15-2008, 04:23 PM
  5. [SOLVED] Is there a way to identify saturday and sunday automatically
    By Unicornlmb in forum Excel General
    Replies: 2
    Last Post: 01-05-2006, 01:40 PM

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