View Single Post
 
Old 09-12-2022, 05:34 PM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Windows 10 Office 2019
Competent Performer
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 200
Cendrinne is on a distinguished road
Default oh Wow, that is awesome

Quote:
Originally Posted by Guessed View Post
3E+07 means 3 followed by 7 zeros and is spoken as "three times ten to the power of seven".

If your totals are always whole numbers you can specify the formatting of the answer like this
Code:
MsgBox Format(Selection.Calculate,"#,##0")
or show two decimal places like this
Code:
MsgBox Format(Selection.Calculate,"#,##0.00")
Hint: You can experiment with number formatting in Excel to work out number formatting strings to use in this VBA.
Makes sense, you are right.
Thank you for guiding me. This will help me alot.

But how come the status bar, knows which format to use, it's actually automatic. Why we need to format the numbers in a MsgBox???

Just curiuos, if you know the answer. I was often told that Word is dum, not smart. I find it's actually pretty smart to know which format to use.

Thanks again,
Reply With Quote