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

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
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,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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