ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Format results in Message Box (https://www.excelbanter.com/excel-discussion-misc-queries/132487-format-results-message-box.html)

Jim G

Format results in Message Box
 
I currently use,
MsgBox "Total Sales Value of All Jobs is: " &
Sheets("Sums").Range("b4").Value & vbNewLine & _
" " & vbNewLine & _
"Total Cost of Current Jobs is " & Sheets("sums").Range("c4").Value
& vbNewLine & _
" " & vbNewLine & _
"The Average Margin is " & Sheets("sums").Range("e4").Value, _
, "Summary of Active Jobs"

To provide a summary of the results in the nominated cells. The result is
unformatted. What do I need to add to format into $ and %.

Thanks for the help
--
Jim

Gary''s Student

Format results in Message Box
 
If the cells you are showing are aleady properly formatted on the worksheeet,
then use:

Sheets("sums").Range("c4").Text

in place of

Sheets("sums").Range("c4").Value
--
Gary''s Student
gsnu200708


"Jim G" wrote:

I currently use,
MsgBox "Total Sales Value of All Jobs is: " &
Sheets("Sums").Range("b4").Value & vbNewLine & _
" " & vbNewLine & _
"Total Cost of Current Jobs is " & Sheets("sums").Range("c4").Value
& vbNewLine & _
" " & vbNewLine & _
"The Average Margin is " & Sheets("sums").Range("e4").Value, _
, "Summary of Active Jobs"

To provide a summary of the results in the nominated cells. The result is
unformatted. What do I need to add to format into $ and %.

Thanks for the help
--
Jim


JMay

Format results in Message Box
 
with 1123 In Cell B4 (Formatted as General)
In the Immediate Window I entered:

Msgbox "The value in Cell B4 is " &
Format(Range("B4").Value,"$#,##0.00")

MsgBox Displays: The value in Cell B4 is $1,123.00

HTH

Jim May



"Gary''s Student" wrote in
message :

If the cells you are showing are aleady properly formatted on the worksheeet,
then use:

Sheets("sums").Range("c4").Text

in place of

Sheets("sums").Range("c4").Value
--
Gary''s Student
gsnu200708


"Jim G" wrote:

I currently use,
MsgBox "Total Sales Value of All Jobs is: " &
Sheets("Sums").Range("b4").Value & vbNewLine & _
" " & vbNewLine & _
"Total Cost of Current Jobs is " & Sheets("sums").Range("c4").Value
& vbNewLine & _
" " & vbNewLine & _
"The Average Margin is " & Sheets("sums").Range("e4").Value, _
, "Summary of Active Jobs"

To provide a summary of the results in the nominated cells. The result is
unformatted. What do I need to add to format into $ and %.

Thanks for the help
--
Jim



Jim G

Format results in Message Box
 
Terrifically simple, and so I learn some new tricks, thanks a lot.
--
Jim


"Gary''s Student" wrote:

If the cells you are showing are aleady properly formatted on the worksheeet,
then use:

Sheets("sums").Range("c4").Text

in place of

Sheets("sums").Range("c4").Value
--
Gary''s Student
gsnu200708


"Jim G" wrote:

I currently use,
MsgBox "Total Sales Value of All Jobs is: " &
Sheets("Sums").Range("b4").Value & vbNewLine & _
" " & vbNewLine & _
"Total Cost of Current Jobs is " & Sheets("sums").Range("c4").Value
& vbNewLine & _
" " & vbNewLine & _
"The Average Margin is " & Sheets("sums").Range("e4").Value, _
, "Summary of Active Jobs"

To provide a summary of the results in the nominated cells. The result is
unformatted. What do I need to add to format into $ and %.

Thanks for the help
--
Jim



All times are GMT +1. The time now is 09:01 PM.

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