How to identify todays day, not date?
Upcoming Power Excel Seminars
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: How to identify todays day, not date?

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Posts
    117
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    Hi-

    Private Sub CommandButton2_Click()
    If today = Tuesday Then
    MsgBox "OK"
    End If
    End Sub

    How do you write a code that tells what today's day is, so that if today is Tuesday, then a msgbox pops up?

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Bogota, Colombia
    Posts
    11,959
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-09 15:59, Todd_M wrote:
    Hi-

    Private Sub CommandButton2_Click()
    If today = Tuesday Then
    MsgBox "OK"
    End If
    End Sub

    How do you write a code that tells what today's day is, so that if today is Tuesday, then a msgbox pops up?
    Some options:

    If Weekday(Date,vbMonday) = 2 then

    or

    If Format(Date,"ddd") = "tue" then

    or

    If Format(Date,"dddd" = "tuesday" then
    Regards,

    Juan Pablo González
    http://www.juanpg.com

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Posts
    117
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Thanks Juan

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com