number format msgbox

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

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

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:

Deleting cells, Rows & columns

place your cursor on a cell, row number or column letter and use CTRL + -.

View all Excel hints and tips


Server loaded in 0.08 secs.