Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default 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   Report Post  
Posted to microsoft.public.excel.programming
JK JK is offline
external usenet poster
 
Posts: 9
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
WEEKDAY() function: display TEXT not numeric weekday tom Excel Discussion (Misc queries) 3 November 21st 06 04:32 PM
WEEKDAY() Epinn New Users to Excel 29 September 10th 06 11:39 AM
Weekday Darts via OfficeKB.com Excel Discussion (Misc queries) 3 May 26th 06 06:26 PM
Weekday Thomas Excel Worksheet Functions 6 January 29th 06 01:07 AM
WEEKDAY using IF lunker55 Excel Discussion (Misc queries) 2 December 4th 04 03:34 PM


All times are GMT +1. The time now is 03:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"