Textbox format in a VBA userform

VBAisthebest

New Member
Joined
Aug 27, 2015
Messages
1
Hello guys,
Kindly help me with the code to format numerical data(like 1000,000.00) from calculated cells in my sheet to be entered into the textbox. I will be very grateful to get some assistance on this issue.
I have tried this below;
Private Sub TextBox1_Change()
TextBox1.Value = Format(TextBox1.Value, "#,###")
End Sub

and

Private Sub TextBox1_AfterUpdate()
TextBox1.Value = Format(TextBox1.Value, "0,000.00")
End Sub

But it returns an error message that VBA cant find project of library. What can i do ? Thanks
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Forum statistics

Threads
1,216,126
Messages
6,129,004
Members
449,480
Latest member
yesitisasport

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