Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

number format msgbox

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

Number format in msgbox

ResolvedVersion 2003

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

Number format in msgbox

How can you format numbers in the msgbox?

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


 

Training courses

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
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

How to select certain data in an Excel 2010 workbook

If you want to select the correct data set in a page full of data, the most accurate and efficient way of doing this is to use the ''Shift and Click'' technique.

For example: If you want to select all data in cells A2 to E10, then click on cell A2, hold down the Shift key and click on cell E10 and all the data you want to see is highlighted.

Keep holding down the Shift key and you can move from cell E10 to any other cell in the spreadsheet.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.08 secs.