98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Formatting of Date-Time stamp and messagebox contents
Formatting of Date-Time stamp and messagebox contents
Resolved · Urgent Priority · Version 2013
Lone has attended:
Excel VBA Intermediate course
Formatting of Date-Time stamp and messagebox contents
Hi,
I wish to ask 2 questions as below:
Q1. How can I ensure that my date and timestamp on a userform textbox works consistently without confusing UK with US time. I have the code:
txtDateTimeStamp....=Format(txt...Value, "dd mmmm yyyy hh:mm")
This was working well last month but is now showing 12 March 2014 instead of 3 December 2014 or 12 January 2014 instead of 1 December 2014.
Q2. How can I format the contents of a messagebox? (e.g., increase the font size, change font type, turn text to bold, etc).
Thanks in advance for your guidance
RE: Formatting of Date-Time stamp and messagebox contents
Hi Lone
Thanks for you questions.
Q1
I've tried to reproduce your example by changing the regional settings from United Kingdom to US in Control Panel. But the form always sees to display the English format on my pc.
Q2
The font size in a standard Message Box can't be changed.
You can in a User form by changing the Font property.
There are ways but you will have to install Extended MessageBox.NET
http://www.news2news.com/vfp/?solution=5
Probably easier to create your own form and use the Properties to control the font size and type.
Regards
Doug Dunn
Best STL
RE: Formatting of Date-Time stamp and messagebox contents
Hi Doug,
Thank you for your response.
I will explore installation of an extended messagebox in view of Q2.
What is the answer to Q1 regarding formatting of a date and time stamp?
Kindest regards,
L
RE: Formatting of Date-Time stamp and messagebox contents
Hi Lone,
I have tested it and on my pc it show the right date format.
I have attached a workbook with a userform which show the current date on load.
I hope this can help you.
Kind regards
Jens Bonde
Microsoft Office Specialist Trainer
Tel: 0207 987 3777
Best STL - https://www.stl-training.co.uk
98%+ recommend us
London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector
RE: Formatting of Date-Time stamp and messagebox contents
Hi Lone,
I have tested it and on my pc it show the right date format.
I have attached a workbook with a userform which show the current date on load.
I hope this can help you.
Kind regards
Jens Bonde
Microsoft Office Specialist Trainer
Tel: 0207 987 3777
Best STL - https://www.stl-training.co.uk
98%+ recommend us
London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector
Attached files...
RE: Formatting of Date-Time stamp and messagebox contents
Hi Jens,
Thank you for your response.
There is nothing in both the workbook (comprising sheet 1) and the userform labelled sheet 1(sheet 1). Please send me an updated workbook regarding formatting of date and time stamp.
Kindest regards,
Lone
RE: Formatting of Date-Time stamp and messagebox contents
Hi Lone,
Sorry it is my fault. I saved the workbook as a xlsx file. I have saved it as a macro enable workbook now.
Please find the attached workbook.
Kind regards
Jens Bonde
Microsoft Office Specialist Trainer
Tel: 0207 987 3777
Best STL - https://www.stl-training.co.uk
98%+ recommend us
London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector
Attached files...
Will be marked as resolved in 5 days
Notice: This is an automated message. Due to inactivity, this forum post will be marked as 'resolved' if there are no further responses in the next 5 days.
RE: Formatting of Date-Time stamp and messagebox contents
Hi Jens,
Thank you for your response and guidance. I have modified the code from the workbook to suit my needs and it is working perfectly.
The code I was using that was confusing US and UK dates is also now working. Since this one has issues of stability or reliability, I will use the one you have suggested and wish to observe it again on 1 January 2015 to confirm and come back to you.
Kindest regards
Training information:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Convert a column into row quickly in Excel 2010Occasionally you might enter data into Excel vertically and then when you finish realize that actually it would look more clearer if it was represented in a horizontal format. If you follow these simple steps below, you can quickly change the data from going vertically to horizontally and vice versa. |