ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Formatting equation output (https://www.excelbanter.com/excel-programming/285282-formatting-equation-output.html)

David Thurston

Formatting equation output
 
Hey there!~

I have a label that shows the result of a calculation that
is performed in the code. Formula is:

lblSalesAmount.Caption = ("$" & ((txtPOAmount.Value *
((txtPercentOffice.Value) / 100))) *
(txtPercentSales.Value / 100))

I need to know how to format this so that when the label
shows the result it is only two decimal places.

Thanks

David

Izar Arcturus

Formatting equation output
 
Try this:

lblSalesAmount.Caption = Format(((txtPOAmount.Value *
((txtPercentOffice.Value) / 100))) *
(txtPercentSales.Value / 100), "$#,##0.00")

-IA
-----Original Message-----
Hey there!~

I have a label that shows the result of a calculation

that
is performed in the code. Formula is:

lblSalesAmount.Caption = ("$" & ((txtPOAmount.Value *
((txtPercentOffice.Value) / 100))) *
(txtPercentSales.Value / 100))

I need to know how to format this so that when the label
shows the result it is only two decimal places.

Thanks

David
.



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

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