Change Number Format of textbox calculation

dlmmrh

New Member
Joined
Jan 22, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello. I am very new to VBA so i have a question.

How do i change number format of the value for textbox total cost?

i know afterupdate but i tried and it work only on textbox that the user input data in but how do i change the number format of value that is calculated from data input by users? i want it to look like this "451,980.00" instead of just round number. same goes to value of textbox totarea and cost/m2

Thank you in advance

1642965616651.png
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
If the textbox is called textbox1
Maybe
VBA Code:
Textbox1 =format(textbox1,"###,###.00")
 
Upvote 0
If you are in the VB editor screen does the workbook have a UserForm (in the Project window on the left) ?
Double click on that and then double click on the form (or right click and select View Code).

In the code window, I suggest you look at the Length. It already does what you are asking for, see if you can find the way that was done and apply it to the others you want done the same way.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,636
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top