+ Reply to Thread
Results 1 to 13 of 13

Msgbox only on non-monday

  1. #1
    Forum Contributor
    Join Date
    09-05-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    222

    Msgbox only on non-monday

    Could someone help me with this?
    I want MSGBOX if current day is NOT Monday.
    Somethingn like this.
    Please Login or Register  to view this content.

  2. #2
    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
    53,053

    Re: Msgbox only on non-monday

    Not sure how you would build this into your code (my VBA sucks), but this will tell you if the date is not monday....
    =WEEKDAY(A15,2)>1
    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

  3. #3
    Forum Contributor
    Join Date
    12-27-2012
    Location
    cebu, Philippines
    MS-Off Ver
    Excel 2016
    Posts
    210

    Re: Msgbox only on non-monday

    try edit this:

    Please Login or Register  to view this content.


    so probably it'll be like this:

    Please Login or Register  to view this content.
    don't worry, there's a lot of people that are far more confused than you
    but if you liked what i suggested. Click for me the "Add Reputation" - that way, we'd be both happy.

  4. #4
    Forum Contributor
    Join Date
    09-05-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    222

    Re: Msgbox only on non-monday

    Here's little bit more of it.
    Please Login or Register  to view this content.
    I can't get it to put X on B27.

  5. #5
    Forum Contributor
    Join Date
    12-27-2012
    Location
    cebu, Philippines
    MS-Off Ver
    Excel 2016
    Posts
    210

    Re: Msgbox only on non-monday

    change that to this:

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    09-05-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    222

    Re: Msgbox only on non-monday

    What's the difference, beside the mispell of TWONE?
    Anyway, it didn't work.
    It's this part it doesn't like.
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    12-27-2012
    Location
    cebu, Philippines
    MS-Off Ver
    Excel 2016
    Posts
    210

    Re: Msgbox only on non-monday

    gota be the mispelled part...

    it should be
    Please Login or Register  to view this content.
    and no need to put the else statement if you have nothing else... :D

  8. #8
    Forum Contributor
    Join Date
    09-05-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    222

    Re: Msgbox only on non-monday

    Well, once YES is confirmed, it go straight to second end if
    Quote Originally Posted by ag273n View Post
    gota be the mispelled part...
    it should be
    It's just for myself, still learning
    Quote Originally Posted by ag273n View Post
    and no need to put the else statement if you have nothing else... :D

  9. #9
    Forum Contributor
    Join Date
    09-05-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    222

    Re: Msgbox only on non-monday

    I got it.
    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    12-27-2012
    Location
    cebu, Philippines
    MS-Off Ver
    Excel 2016
    Posts
    210

    Re: Msgbox only on non-monday

    you could make it like...


    Please Login or Register  to view this content.
    if there's nothing else in the else statement then the above code should be fine

  11. #11
    Forum Contributor
    Join Date
    09-05-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    222

    Re: Msgbox only on non-monday

    Ok, I guess I need help understanding this weekday stuff.
    The code above is one I got from internet.
    Trying to understand their explanation but not getting it.
    I get Sunday = 1 thru Saturday = 7
    this part i just dont understand.
    Please Login or Register  to view this content.
    Could someone show me a sample code?
    If it's Monday,
    msgbox "IT IS MONDAY"

    If it NOT Monday
    msgbox "today is NOT Monday"

  12. #12
    Forum Contributor
    Join Date
    12-27-2012
    Location
    cebu, Philippines
    MS-Off Ver
    Excel 2016
    Posts
    210

    Re: Msgbox only on non-monday

    Microsoft office's explanation of that function can be found on the help too in the VB editor.
    you don't have to use all 4 examples, at least 1 can work for your purpose,

    Syntax
    WeekdayName(weekday, abbreviate, firstdayofweek)


    example:
    Please Login or Register  to view this content.
    would return "Monday"

    Day of the week
    First day of the week you consider

    (i believe)the above function cannot discriminate the current date if its monday or not since it doesn't take a variable like a date

  13. #13
    Forum Contributor
    Join Date
    09-05-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    222

    Re: Msgbox only on non-monday

    Ok, someone just told me this and I like it a lot and easy to understand.
    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] Problem with VBA Editor uses lower case on some lines (ex. msgbox instead of MsgBox)
    By stubbsj in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-14-2013, 06:59 PM
  2. [SOLVED] Find monday preceeding given-date unless date is a monday
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-10-2012, 07:42 AM
  3. MsgBox-center the message on a msgbox
    By CobraLAD in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-11-2007, 06:48 AM
  4. MsgBox-at the end a msgBox popup
    By CC in forum Excel General
    Replies: 4
    Last Post: 05-05-2006, 12:50 PM
  5. Replies: 1
    Last Post: 04-13-2005, 06:35 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