+ Reply to Thread
Results 1 to 3 of 3

Date help, if selected date is saturday then expression returns true

  1. #1
    Registered User
    Join Date
    04-29-2004
    Posts
    92

    Date help, if selected date is saturday then expression returns true

    Hola excel programmers, I'm creating a scheduling system for fun and I need a simple if statement to detect if the day is a saturday. If it isnt, msgbox "sorry, starting date must be a saturday."

    thinking of it this way, it would/should look something like this.

    if worksheets("sheet1").range("a1").value <> saturday then
    msgbox "sorry, starting date must be a saturday."
    end if

    Should hopefully be fairly simple


    Thanks in advance.
    Chris

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hola Chris,

    You almost have it. You just need the Weekday function added. Sunday is 1, Monday 2, Tuesday 3, Wednesday 4, Thursday 5, Friday 6, Saturday 7.

    Example:
    If Weekday(Worksheets("Sheet1").Range("A1").Value) = 7 Then
    MsgBox "sorry, starting date must be a saturday."
    End If


    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    04-29-2004
    Posts
    92
    Great! Thanks for the quick reply Mr.ross

    knew it couldnt be too tuff

+ 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