ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Msgbox - Puting current date in a message box (https://www.excelbanter.com/excel-programming/288837-msgbox-puting-current-date-message-box.html)

rglasunow[_4_]

Msgbox - Puting current date in a message box
 
Is there a way to put the current date in a message box. I want to be
able to say hello to the user. Simular to below?

Msgbox = "Hello " & Application.Username & "."

Thanks in advance!!


---
Message posted from http://www.ExcelForum.com/


Bob Phillips[_6_]

Msgbox - Puting current date in a message box
 
Msgbox = "Hello " & Application.Username & ". " & Format(Date,"dd mmm yyyy")

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"rglasunow " wrote in message
...
Is there a way to put the current date in a message box. I want to be
able to say hello to the user. Simular to below?

Msgbox = "Hello " & Application.Username & "."

Thanks in advance!!


---
Message posted from http://www.ExcelForum.com/




mudraker[_122_]

Msgbox - Puting current date in a message box
 
Msgbox = "Hello " & Application.Username & ". "
format(now(),"dd/mm"yy

--
Message posted from http://www.ExcelForum.com


rglasunow[_5_]

Msgbox - Puting current date in a message box
 
I tried what you both reccomended and thank you for the quick reply.
However, I keep getting the following error when using both the the
commands.

Compile Error:
Function call on the left-hand side of assignment must return Variant
or Object.

then
MsgBox = is highlighted.

I just want an ok button to appear on in the message box not a Yes, No,
Ok or Cancel command.

any sugestions?
Thanks!


---
Message posted from http://www.ExcelForum.com/


Chip Pearson

Msgbox - Puting current date in a message box
 
Get rid of the = character. E.g.,

Msgbox "Hello " & Application.Username & ". " & Format(Date,"dd
mmm yyyy")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"rglasunow " wrote in
message ...
I tried what you both reccomended and thank you for the quick

reply.
However, I keep getting the following error when using both the

the
commands.

Compile Error:
Function call on the left-hand side of assignment must return

Variant
or Object.

then
MsgBox = is highlighted.

I just want an ok button to appear on in the message box not a

Yes, No,
Ok or Cancel command.

any sugestions?
Thanks!


---
Message posted from http://www.ExcelForum.com/




rglasunow[_6_]

Msgbox - Puting current date in a message box
 
Sweet!!!! It worked

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 09:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com