ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Msgbox help (https://www.excelbanter.com/excel-programming/280660-msgbox-help.html)

JonoB

Msgbox help
 
I am trying to return a value to a msgbox, but instead of just the
actual value, I want the number to be formatted as fixed (i.e. using
"," as thousand seperator and only 2 decimal places).

My code so far is (and NAP is a named range in my worksheet):

_________

Dim getNAP
Dim msgA

getNAP = Range("NAP")

msgA = MsgBox("The final valuation is " & getNAP)
__________


This works fine, except I want the msgbox to show "The final valuation
is 19,352,654.23" instead of "The final valuation is 19352654.231432"


Thanks for the help.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


merjet

Msgbox help
 
I am trying to return a value to a msgbox, but instead of just the
actual value, I want the number to be formatted as fixed (i.e. using
"," as thousand seperator and only 2 decimal places).


MsgBox("The final valuation is " & Format(getNAP, "##,##0.00"))

HTH,
Merjet



JonoB[_2_]

Msgbox help
 
Thanks, works perfectly...




All times are GMT +1. The time now is 08:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com