Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Formatting calculated number appearing in the text in message boxes

I have a pretty basic macro, at the end of which will be the appearance
of a couple of "information only" message boxes, written as follows:

Msg = Application.UserName & " some text here " & (Range("Rreal").Value
/ 1000) & " more text here " & Range("NPV").Value & " further text
here"

Ans = MsgBox(Msg, vbYesNo)

If Ans = vbNo Then MsgBox " some explanatory text here if answer
yes "

If Ans = vbYes Then MsgBox " some explanatory text here if answer
no "

Msg = " some text here " & Application.UserName & " more text here
" & (Range("IRR").Value / 1000) & " further text here " &
(Range("Rreal").Value / 1000) & "?"

Ans = MsgBox(Msg, vbYesNo)

If Ans = vbNo Then MsgBox " some explanatory text here if answer no
"

If Ans = vbYes Then MsgBox " some explanatory text here if answer
yes "


My problem is the ( Rreal / 1000 ) and ( IRR / 1000 ) appear as, say,
0.15 when I want it to appear as 15.0% within the message box text, and
NPV appears as, say, -186845858.3464 when I would want it to appear as
$(186,845,858.35).

Is there any easier way of formatting these numbers within the text of
a message box?

Thanks in advance for any help

Mike

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Formatting calculated number appearing in the text in message boxe

Format(Range("Rreal").Value,"0.0%")
Format(Range("NPV").Value,"[$$-409]# ##0.00;[$$-409](# ##0.00)")


Regards,
Stefi

€ ezt Ã*rta:

I have a pretty basic macro, at the end of which will be the appearance
of a couple of "information only" message boxes, written as follows:

Msg = Application.UserName & " some text here " & (Range("Rreal").Value
/ 1000) & " more text here " & Range("NPV").Value & " further text
here"

Ans = MsgBox(Msg, vbYesNo)

If Ans = vbNo Then MsgBox " some explanatory text here if answer
yes "

If Ans = vbYes Then MsgBox " some explanatory text here if answer
no "

Msg = " some text here " & Application.UserName & " more text here
" & (Range("IRR").Value / 1000) & " further text here " &
(Range("Rreal").Value / 1000) & "?"

Ans = MsgBox(Msg, vbYesNo)

If Ans = vbNo Then MsgBox " some explanatory text here if answer no
"

If Ans = vbYes Then MsgBox " some explanatory text here if answer
yes "


My problem is the ( Rreal / 1000 ) and ( IRR / 1000 ) appear as, say,
0.15 when I want it to appear as 15.0% within the message box text, and
NPV appears as, say, -186845858.3464 when I would want it to appear as
$(186,845,858.35).

Is there any easier way of formatting these numbers within the text of
a message box?

Thanks in advance for any help

Mike


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Formatting calculated number appearing in the text in message boxe

Stefi, you're a star! Many thanks

Stefi wrote:

Format(Range("Rreal").Value,"0.0%")
Format(Range("NPV").Value,"[$$-409]# ##0.00;[$$-409](# ##0.00)")


Regards,
Stefi

" ezt írta:

I have a pretty basic macro, at the end of which will be the appearance
of a couple of "information only" message boxes, written as follows:

Msg = Application.UserName & " some text here " & (Range("Rreal").Value
/ 1000) & " more text here " & Range("NPV").Value & " further text
here"

Ans = MsgBox(Msg, vbYesNo)

If Ans = vbNo Then MsgBox " some explanatory text here if answer
yes "

If Ans = vbYes Then MsgBox " some explanatory text here if answer
no "

Msg = " some text here " & Application.UserName & " more text here
" & (Range("IRR").Value / 1000) & " further text here " &
(Range("Rreal").Value / 1000) & "?"

Ans = MsgBox(Msg, vbYesNo)

If Ans = vbNo Then MsgBox " some explanatory text here if answer no
"

If Ans = vbYes Then MsgBox " some explanatory text here if answer
yes "


My problem is the ( Rreal / 1000 ) and ( IRR / 1000 ) appear as, say,
0.15 when I want it to appear as 15.0% within the message box text, and
NPV appears as, say, -186845858.3464 when I would want it to appear as
$(186,845,858.35).

Is there any easier way of formatting these numbers within the text of
a message box?

Thanks in advance for any help

Mike



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Formatting calculated number appearing in the text in message boxes

Msg = " some text here " & Application.UserName & " more text here
" & Format(Range("IRR").Value / 1000,"0%") & " further text here " &
Format(Range("Rreal").Value / 1000,"0%") & "?"


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

wrote in message
oups.com...
I have a pretty basic macro, at the end of which will be the appearance
of a couple of "information only" message boxes, written as follows:

Msg = Application.UserName & " some text here " & (Range("Rreal").Value
/ 1000) & " more text here " & Range("NPV").Value & " further text
here"

Ans = MsgBox(Msg, vbYesNo)

If Ans = vbNo Then MsgBox " some explanatory text here if answer
yes "

If Ans = vbYes Then MsgBox " some explanatory text here if answer
no "

Msg = " some text here " & Application.UserName & " more text here
" & (Range("IRR").Value / 1000) & " further text here " &
(Range("Rreal").Value / 1000) & "?"

Ans = MsgBox(Msg, vbYesNo)

If Ans = vbNo Then MsgBox " some explanatory text here if answer no
"

If Ans = vbYes Then MsgBox " some explanatory text here if answer
yes "


My problem is the ( Rreal / 1000 ) and ( IRR / 1000 ) appear as, say,
0.15 when I want it to appear as 15.0% within the message box text, and
NPV appears as, say, -186845858.3464 when I would want it to appear as
$(186,845,858.35).

Is there any easier way of formatting these numbers within the text of
a message box?

Thanks in advance for any help

Mike



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Formatting calculated number appearing in the text in message

You are welcome! Thanks for the feedback!
Stefi


€žMikeCM€ ezt Ã*rta:

Stefi, you're a star! Many thanks

Stefi wrote:

Format(Range("Rreal").Value,"0.0%")
Format(Range("NPV").Value,"[$$-409]# ##0.00;[$$-409](# ##0.00)")


Regards,
Stefi

" ezt Ã*rta:

I have a pretty basic macro, at the end of which will be the appearance
of a couple of "information only" message boxes, written as follows:

Msg = Application.UserName & " some text here " & (Range("Rreal").Value
/ 1000) & " more text here " & Range("NPV").Value & " further text
here"

Ans = MsgBox(Msg, vbYesNo)

If Ans = vbNo Then MsgBox " some explanatory text here if answer
yes "

If Ans = vbYes Then MsgBox " some explanatory text here if answer
no "

Msg = " some text here " & Application.UserName & " more text here
" & (Range("IRR").Value / 1000) & " further text here " &
(Range("Rreal").Value / 1000) & "?"

Ans = MsgBox(Msg, vbYesNo)

If Ans = vbNo Then MsgBox " some explanatory text here if answer no
"

If Ans = vbYes Then MsgBox " some explanatory text here if answer
yes "


My problem is the ( Rreal / 1000 ) and ( IRR / 1000 ) appear as, say,
0.15 when I want it to appear as 15.0% within the message box text, and
NPV appears as, say, -186845858.3464 when I would want it to appear as
$(186,845,858.35).

Is there any easier way of formatting these numbers within the text of
a message box?

Thanks in advance for any help

Mike






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Formatting calculated number appearing in the text in message

Stefi/Bob - thanks both of you - much appreciated


Stefi wrote:
You are welcome! Thanks for the feedback!
Stefi


,,MikeCM" ezt írta:

Stefi, you're a star! Many thanks

Stefi wrote:

Format(Range("Rreal").Value,"0.0%")
Format(Range("NPV").Value,"[$$-409]# ##0.00;[$$-409](# ##0.00)")


Regards,
Stefi

" ezt írta:

I have a pretty basic macro, at the end of which will be the appearance
of a couple of "information only" message boxes, written as follows:

Msg = Application.UserName & " some text here " & (Range("Rreal")..Value
/ 1000) & " more text here " & Range("NPV").Value & " further text
here"

Ans = MsgBox(Msg, vbYesNo)

If Ans = vbNo Then MsgBox " some explanatory text here if answer
yes "

If Ans = vbYes Then MsgBox " some explanatory text here if answer
no "

Msg = " some text here " & Application.UserName & " more text here
" & (Range("IRR").Value / 1000) & " further text here " &
(Range("Rreal").Value / 1000) & "?"

Ans = MsgBox(Msg, vbYesNo)

If Ans = vbNo Then MsgBox " some explanatory text here if answer no
"

If Ans = vbYes Then MsgBox " some explanatory text here if answer
yes "


My problem is the ( Rreal / 1000 ) and ( IRR / 1000 ) appear as, say,
0.15 when I want it to appear as 15.0% within the message box text, and
NPV appears as, say, -186845858.3464 when I would want it to appear as
$(186,845,858.35).

Is there any easier way of formatting these numbers within the text of
a message box?

Thanks in advance for any help

Mike





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
format a number appearing in a text formula ogerriz Excel Discussion (Misc queries) 2 May 9th 09 05:31 AM
# sign appearing in text boxes, Why? Zaphod42b Excel Discussion (Misc queries) 4 May 28th 08 02:44 PM
Conditional Formatting on calculated text gin Excel Worksheet Functions 3 June 13th 07 06:23 PM
formatting text boxes doug Excel Programming 3 February 15th 05 06:53 PM
Error Message Appearing JaneC Excel Discussion (Misc queries) 1 December 6th 04 11:40 PM


All times are GMT +1. The time now is 02:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"