number format msgbox
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Number format in msgbox

Number format in msgbox

resolvedResolved · Low Priority · Version 2003

replyReply Fri 20 Feb 2009, 14:54Delegate Oliver said...

Oliver has attended:
Excel VBA Intro Intermediate course
Excel VBA Advanced course

Number format in msgbox

How can you format numbers in the msgbox?

For upcoming training course dates see: Pricing & availability

replyReply Wed 25 Feb 2009, 14:41Trainer Stephen said...

RE: Number format in msgbox

Hi Oliver

Thank you for your question

You can format numbers using the vb FORMAT function.

For example the following code can be used to format a number in a message box so that it has a comma thousand separator and 2 decimal places


Dim intNumber As Integer


intNumber = 1232.3


MsgBox Format(intNumber, "##,##0.00")



The function can also be used to format dates. You can find more info by using the vb help tool

Regards

Stephen


 

Please browse our web site to find out more about
excel-training-course and other Microsoft training courses.

Excel tip:

View a unique list

You have a column with hundreds of entries, and you need to see what unique items are entered in it. Select any cell in that column, hold down Alt and press the down arrow: Excel produces an alphabetically-sorted list of unique entries in that column.

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard