Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Number format in msgbox
Number format in msgbox
Resolved · 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?
For upcoming training course dates see: Pricing & availability
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
|
