+ Reply to Thread
Results 1 to 2 of 2

which weekday?

  1. #1
    Arne Hegefors
    Guest

    which weekday?

    I have the following code now:

    If Day(strStartDatumArray(0)) = 1 Or Day(strStartDatumArray(0)) = 7 Then
    msgbox("you have choosen a weekend!")
    End If

    However I want to be able to tell the user if he/she has chosen a saturday
    or sunday. I think there is a vba function that returns the name of the day.
    I know you can do this be yourself but it would be nicer to use function that
    gives you the name of the day so that you can write:

    msgbox("you have chosen a " & WeekdayName(strStartDatumArray(0)) & ". Please
    choose a weekday instead!")

    As I said I know you write some case select or something that solves this
    problem also but I would like to know the vba function that does it
    automatically. Thanks alot in advance!


  2. #2
    JK
    Guest

    Re: which weekday?

    You could use something like:

    MsgBox("You have chosen a " &
    WeekDayName(WeekDay(strStartDatumArray(0))) & ". Please choose a
    weekday instead!")

    -JK
    Arne Hegefors wrote:
    > I have the following code now:
    >
    > If Day(strStartDatumArray(0)) = 1 Or Day(strStartDatumArray(0)) = 7 Then
    > msgbox("you have choosen a weekend!")
    > End If
    >
    > However I want to be able to tell the user if he/she has chosen a saturday
    > or sunday. I think there is a vba function that returns the name of the day.
    > I know you can do this be yourself but it would be nicer to use function that
    > gives you the name of the day so that you can write:
    >
    > msgbox("you have chosen a " & WeekdayName(strStartDatumArray(0)) & ". Please
    > choose a weekday instead!")
    >
    > As I said I know you write some case select or something that solves this
    > problem also but I would like to know the vba function that does it
    > automatically. Thanks alot in advance!



+ 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