![]() |
Value Returned in Message Box Q
I have the following Message box that appears on Wroksheet_Open. It
returns a date value from sheet Sum AC1, but instead of appearing in the MB as 02/12/07, it appears as 02/12/07 17:00. The cell AC1 is formatted as Date: dd/mm/yy. How can I also get the value that is returned in AC1 appear in the MB as dd/mm/yy? MsgBox "Be on Time submitting" & vbCr & _ "" & vbCr & _ "Next due date is 5:00pm on " & Worksheets("Sum").Range("AC1") |
Value Returned in Message Box Q
try using format
MsgBox Format(Worksheets("Sum").Range("AC1"), "mm/dd/yy") -- Gary "Sean" wrote in message ... I have the following Message box that appears on Wroksheet_Open. It returns a date value from sheet Sum AC1, but instead of appearing in the MB as 02/12/07, it appears as 02/12/07 17:00. The cell AC1 is formatted as Date: dd/mm/yy. How can I also get the value that is returned in AC1 appear in the MB as dd/mm/yy? MsgBox "Be on Time submitting" & vbCr & _ "" & vbCr & _ "Next due date is 5:00pm on " & Worksheets("Sum").Range("AC1") |
Value Returned in Message Box Q
Sean,
Change Worksheets("Sum").Range("AC1") to Format(Worksheets("Sum").Range("AC1").Value,"dd-mmm-yyyy") or to Worksheets("Sum").Range("AC1").Text Change the number format to the appropriate date string. -- Cordially, Chip Pearson Microsoft MVP - Excel, 10 Years Pearson Software Consulting www.cpearson.com (email on the web site) "Sean" wrote in message ... I have the following Message box that appears on Wroksheet_Open. It returns a date value from sheet Sum AC1, but instead of appearing in the MB as 02/12/07, it appears as 02/12/07 17:00. The cell AC1 is formatted as Date: dd/mm/yy. How can I also get the value that is returned in AC1 appear in the MB as dd/mm/yy? MsgBox "Be on Time submitting" & vbCr & _ "" & vbCr & _ "Next due date is 5:00pm on " & Worksheets("Sum").Range("AC1") |
Value Returned in Message Box Q
Thanks Chip & Gary
|
All times are GMT +1. The time now is 06:11 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com