Consulting

Results 1 to 3 of 3

Thread: Solved: MsgBox

  1. #1
    VBAX Regular
    Joined
    Oct 2010
    Location
    Texas
    Posts
    93
    Location

    Solved: MsgBox

    Hello Everyone,

    I need your help. I'm trying to display a greeting when a user opens a spreadsheet. The greeting changes depending on the time of day. I want to change the title of the message box. I'm not having any luck. Here's what I have so far:

    [VBA]
    Public Sub Auto_Open()
    If Time < 0.5 Then MsgBox "Good Morning!"
    If Time >= 0.5 And Time < 0.75 Then MsgBox "Good Afternoon!"
    If Time >= 0.75 Then MsgBox "Good Evening!"
    [/VBA]
    I know the syntax is MsgBox(prompt,[buttons],[title],[helpfile, context]) but I can't seem to enter a title.

    Thank you for any assistance you can provide!!

  2. #2
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    like this[VBA]MsgBox "Good Morning!",vbokonly,"This is the morning title"[/VBA]
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  3. #3
    VBAX Regular
    Joined
    Oct 2010
    Location
    Texas
    Posts
    93
    Location
    That works great!

    Thank you very much!!

Posting Permissions

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