which weekday?

A

Arne Hegefors

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!
 
J

JK

You could use something like:

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

-JK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top