Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default format values in MsgBox?

Hello,

I would like to give the user of an application feedback on found data
after a search in a simple msgbox.

the box will contain date, some integers and a few decimal values.
Problem is; how do I format some figures to have, say 2 decimals
shown, use 'thousand-separator' etc? Can I use something like
NumberFormat = "#,##0.00" in separate items of the msgbox?

Here is my code:
For j = 3 To cellsDown
If loanNumber = Cells(j, 19).Value Then
MsgBox ("Følgende lån funnet:") & vbCrLf & vbCrLf & "Låntaker: " &
Cells(j, 3).Value _
& vbCrLf & "Valuta: " & Cells(j, 9).Value & vbCrLf & "Credit: " &
Cells(j, 7).Value _
& vbCrLf & "SLS Lån: " & Cells(j, 8).Value & vbCrLf & "Dato
utbetalt: " & Cells(j, 25).Value _
& vbCrLf & "Beløp utbetalt: " & Cells(j, 26).Value & vbCrLf &
"Kurs utbetalt: " & Cells(j, 27).Value _
, vbYesNo, "Detaljer"
Exit Sub
End If
Next j



Best regards,
NorTor


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default format values in MsgBox?

Use either the format function

Format(Cells(j,9).Value,"#,##0.00")

or if the cells are formatted they way you want

Use Cells(j,9).Text in your string rather than Cells(j,9) or
Cells(j,9).value

--
Regards,
Tom Ogilvy


"NorTor" wrote in message
...
Hello,

I would like to give the user of an application feedback on found data
after a search in a simple msgbox.

the box will contain date, some integers and a few decimal values.
Problem is; how do I format some figures to have, say 2 decimals
shown, use 'thousand-separator' etc? Can I use something like
NumberFormat = "#,##0.00" in separate items of the msgbox?

Here is my code:
For j = 3 To cellsDown
If loanNumber = Cells(j, 19).Value Then
MsgBox ("Følgende lån funnet:") & vbCrLf & vbCrLf & "Låntaker: " &
Cells(j, 3).Value _
& vbCrLf & "Valuta: " & Cells(j, 9).Value & vbCrLf & "Credit: " &
Cells(j, 7).Value _
& vbCrLf & "SLS Lån: " & Cells(j, 8).Value & vbCrLf & "Dato
utbetalt: " & Cells(j, 25).Value _
& vbCrLf & "Beløp utbetalt: " & Cells(j, 26).Value & vbCrLf &
"Kurs utbetalt: " & Cells(j, 27).Value _
, vbYesNo, "Detaljer"
Exit Sub
End If
Next j



Best regards,
NorTor




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default format values in MsgBox?

Ten minutes after I send my request, Tom gives me a perfect solution!
Thank you so much Tom, I really appreciate your help!


Best regards,
NorTor



On Tue, 9 Sep 2003 09:09:56 -0400, "Tom Ogilvy"
wrote:

Use either the format function

Format(Cells(j,9).Value,"#,##0.00")

or if the cells are formatted they way you want

Use Cells(j,9).Text in your string rather than Cells(j,9) or
Cells(j,9).value


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
Converting values which are in Numeric format to word format Frnc Excel Discussion (Misc queries) 1 July 2nd 08 08:42 AM
How do I format a MSGBOX to show text and variables in a macro? Pank New Users to Excel 4 March 22nd 07 01:10 PM
msgBox sum values Claudio Silva Excel Discussion (Misc queries) 1 January 18th 07 12:38 PM
MsgBox bumper338 Excel Discussion (Misc queries) 1 December 22nd 06 11:32 PM
msgbox flow23 Excel Discussion (Misc queries) 0 January 10th 06 03:25 PM


All times are GMT +1. The time now is 12:19 PM.

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

About Us

"It's about Microsoft Excel"