Textbox number formatting

dave8

Active Member
Joined
Jul 8, 2007
Messages
267
How to format a Textbox such that if I enter, 1000, it will display 1,000? And if I enter 10000, it will display 10,000. Or, 100000, it will display 100,000.
 

Some videos you may like

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Sahak

Well-known Member
Joined
Nov 10, 2006
Messages
874
Try this
Code:
Private Sub TextBox1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
    TextBox1.Value = Format(TextBox1.Value, "#,###")
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,108,938
Messages
5,525,734
Members
409,661
Latest member
pprabha

This Week's Hot Topics

Top