ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Message box to return curency with $ and comma's intact (https://www.excelbanter.com/excel-programming/319307-message-box-return-curency-%24-commas-intact.html)

Ed P[_2_]

Message box to return curency with $ and comma's intact
 
Below is an example of code I have entered. The return is returning correctly
but the cell referenced is not returning with a $ or commas. I can formatted
the cell correctly and I have tried multiple methods includeing Dim x as
curreny with X = Range("D13").Value

If someone can tell me what i am missing I would appreciate it greatly.
Thank you for your help

Private Sub CommandButton2_Click()
If CommandButton1.Value = "Rate Card Regular" Or CommandButton1.Value =
"Rate Card Complex" Or CommandButton1.Value = "Rate Card Regular Rush" Or
CommandButton1.Value = "Rate Card Complex Rush" Then
MsgBox "Rate Card Amount Used = & Range("D13").Value, vbInformation
End If

JulieD

Message box to return curency with $ and comma's intact
 
Hi Ed

one option is to do this:

MsgBox "Rate Card Amount Used = " & Format(Range("D13"), "$#,###.00"),
vbInformation

(note you're also missing a space & " after the =)

Cheers
JulieD


"Ed P" wrote in message
...
Below is an example of code I have entered. The return is returning
correctly
but the cell referenced is not returning with a $ or commas. I can
formatted
the cell correctly and I have tried multiple methods includeing Dim x as
curreny with X = Range("D13").Value

If someone can tell me what i am missing I would appreciate it greatly.
Thank you for your help

Private Sub CommandButton2_Click()
If CommandButton1.Value = "Rate Card Regular" Or CommandButton1.Value =
"Rate Card Complex" Or CommandButton1.Value = "Rate Card Regular Rush" Or
CommandButton1.Value = "Rate Card Complex Rush" Then
MsgBox "Rate Card Amount Used = & Range("D13").Value, vbInformation
End If




Lonnie M.

Message box to return curency with $ and comma's intact
 
Hi, I think that the following will work for you
X = Format(Range("D13").Value, "$#,##0.00")

HTH--Lonnie M.


Tom Ogilvy

Message box to return curency with $ and comma's intact
 
Use the text property to see the cell as it is displayed.

Private Sub CommandButton2_Click()
If CommandButton1.Value = "Rate Card Regular" Or CommandButton1.Value =
"Rate Card Complex" Or CommandButton1.Value = "Rate Card Regular Rush" Or
CommandButton1.Value = "Rate Card Complex Rush" Then
MsgBox "Rate Card Amount Used = & Range("D13").Text, vbInformation
End If

--
Regards,
Tom Ogilvy


"Ed P" wrote in message
...
Below is an example of code I have entered. The return is returning

correctly
but the cell referenced is not returning with a $ or commas. I can

formatted
the cell correctly and I have tried multiple methods includeing Dim x as
curreny with X = Range("D13").Value

If someone can tell me what i am missing I would appreciate it greatly.
Thank you for your help

Private Sub CommandButton2_Click()
If CommandButton1.Value = "Rate Card Regular" Or CommandButton1.Value

=
"Rate Card Complex" Or CommandButton1.Value = "Rate Card Regular Rush" Or
CommandButton1.Value = "Rate Card Complex Rush" Then
MsgBox "Rate Card Amount Used = & Range("D13").Value, vbInformation
End If




Bob Phillips[_6_]

Message box to return curency with $ and comma's intact
 
or maybe

Private Sub CommandButton2_Click()
If CommandButton1.Value = "Rate Card Regular" Or CommandButton1.Value =
"Rate Card Complex" Or CommandButton1.Value = "Rate Card Regular Rush" Or
CommandButton1.Value = "Rate Card Complex Rush" Then
MsgBox "Rate Card Amount Used = " & Range("D13").Text, vbInformation
End If

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Ed P" wrote in message
...
Below is an example of code I have entered. The return is returning

correctly
but the cell referenced is not returning with a $ or commas. I can

formatted
the cell correctly and I have tried multiple methods includeing Dim x as
curreny with X = Range("D13").Value

If someone can tell me what i am missing I would appreciate it greatly.
Thank you for your help

Private Sub CommandButton2_Click()
If CommandButton1.Value = "Rate Card Regular" Or CommandButton1.Value

=
"Rate Card Complex" Or CommandButton1.Value = "Rate Card Regular Rush" Or
CommandButton1.Value = "Rate Card Complex Rush" Then
MsgBox "Rate Card Amount Used = & Range("D13").Value, vbInformation
End If





All times are GMT +1. The time now is 11:02 PM.

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