ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel Form Issues...again :) (https://www.excelbanter.com/excel-programming/302744-excel-form-issues-again.html)

BOHICA

Excel Form Issues...again :)
 
Well hello! You people seem to have an answer for me every time, and
guess what? I GOTS ME ANUTTER!!

Here goes: I have a form that users enter information in, and on
changes to those fields, calculations are performed and results put
into text boxes on the bottom (totals and such). My issue is this: I
want the value calculated to display like money ($##.##). I have
tried setting variables as currency (didn't do nuttin) and have tried
rounding to 2 decimals (didn't do it). When the total has decimals,
it displays them, but absolutely refuses to show me the money so to
speak when it is a whole number. How the hell do I get it to show
them pesky .00's?

(Sample code)

Dim muhTotal As Currency

(also tried this with/without the following code, and the following
code with the above defined as Dim muhTotal)

muhTotal= Round(muhTotal, 2)


So...Whatcha think?

Norman Jones

Excel Form Issues...again :)
 
Hi Bohica.

Try:

muhTotal= format(muhTotal, ,"$#,##0.00")

---
Regards,
Norman



"BOHICA" wrote in message
om...
Well hello! You people seem to have an answer for me every time, and
guess what? I GOTS ME ANUTTER!!

Here goes: I have a form that users enter information in, and on
changes to those fields, calculations are performed and results put
into text boxes on the bottom (totals and such). My issue is this: I
want the value calculated to display like money ($##.##). I have
tried setting variables as currency (didn't do nuttin) and have tried
rounding to 2 decimals (didn't do it). When the total has decimals,
it displays them, but absolutely refuses to show me the money so to
speak when it is a whole number. How the hell do I get it to show
them pesky .00's?

(Sample code)

Dim muhTotal As Currency

(also tried this with/without the following code, and the following
code with the above defined as Dim muhTotal)

muhTotal= Round(muhTotal, 2)


So...Whatcha think?




Bob Phillips[_6_]

Excel Form Issues...again :)
 
TextBox1.Text = Format(muhTotal, "$###,###")

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"BOHICA" wrote in message
om...
Well hello! You people seem to have an answer for me every time, and
guess what? I GOTS ME ANUTTER!!

Here goes: I have a form that users enter information in, and on
changes to those fields, calculations are performed and results put
into text boxes on the bottom (totals and such). My issue is this: I
want the value calculated to display like money ($##.##). I have
tried setting variables as currency (didn't do nuttin) and have tried
rounding to 2 decimals (didn't do it). When the total has decimals,
it displays them, but absolutely refuses to show me the money so to
speak when it is a whole number. How the hell do I get it to show
them pesky .00's?

(Sample code)

Dim muhTotal As Currency

(also tried this with/without the following code, and the following
code with the above defined as Dim muhTotal)

muhTotal= Round(muhTotal, 2)


So...Whatcha think?




BOHICA

Excel Form Issues...again :)
 
WOOOHOOO!!! Thank you again. Worked like a freakin' charm. I am
kicking myself in the ass a bit for not even trying the format, but
whaddyagonnadoo?

Thanks again.


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

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