+ Reply to Thread
Results 1 to 5 of 5

Find weekend days in several ranges, popping up a message

  1. #1
    Registered User
    Join Date
    06-22-2020
    Location
    Lisbon
    MS-Off Ver
    2016
    Posts
    15

    Find weekend days in several ranges, popping up a message

    Hi there,

    struggling with a macro... Purpose is to validate from a range of dates in specific columns (column 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35) if there are any dates falling on Saturdays or Sundays.

    If so, a warning will popup with the cell reference.

    This is what I am using:

    Please Login or Register  to view this content.

    Issue: it is pointing out to the incorrect cell that doesn't have a weekend day (E169). And it misses the one I know it's Saturday (E1239). Changed already several things and cannot figure out

    Thank you so much!

    Regards
    Last edited by Xilofenesor2; 01-13-2022 at 12:39 PM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,410

    Re: Find weekend days in several ranges, popping up a message

    Administrative Note:

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    01-06-2022
    Location
    Wisconsin, United Sates
    MS-Off Ver
    365
    Posts
    4

    Re: Find weekend days in several ranges, popping up a message

    I have a similar function in one of my "Work Calculation" macros. I've edited your code below. Let me know if it works.


    Please Login or Register  to view this content.
    Last edited by ajsobie1980; 01-13-2022 at 01:59 PM.

  4. #4
    Registered User
    Join Date
    06-22-2020
    Location
    Lisbon
    MS-Off Ver
    2016
    Posts
    15

    Re: Find weekend days in several ranges, popping up a message

    Hi,

    thanks for helping, but I got the exact same error. It is pointing out to the incorrect cell that doesn't have a weekend day (E169). And it misses the one I know it's Saturday (E1239).

    Regards.

  5. #5
    Registered User
    Join Date
    01-06-2022
    Location
    Wisconsin, United Sates
    MS-Off Ver
    365
    Posts
    4

    Re: Find weekend days in several ranges, popping up a message

    You could add the following to the case, add a breakpoint where indicated, and then step through the logic and monitor the values to determine the cause of the issue.

    Please Login or Register  to view this content.

+ 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. [SOLVED] Formula to count the days between the ranges exclude weekend
    By roven.aravind in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-15-2018, 04:04 AM
  2. Prevent message boxes from another macro from popping up
    By sczerniak in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 07-11-2013, 02:11 PM
  3. Replies: 8
    Last Post: 03-09-2012, 10:10 AM
  4. Replies: 1
    Last Post: 12-15-2009, 01:22 PM
  5. VBA Error - Popping up message box
    By rajesh_tsr in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-31-2007, 03:09 AM
  6. Replies: 2
    Last Post: 08-03-2006, 09:02 AM
  7. broken links message still popping up
    By GJR3599 in forum Excel General
    Replies: 1
    Last Post: 03-30-2005, 09:06 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