format Text box in userform

  • Thread starter Thread starter amit
  • Start date Start date
A

amit

hi need help with being able to format text box in userforms as $ instead of
an unformatted number. so currently for eg my text box shows 232434 i would
like it to be represented as 232,434$ in the text box....this is a trvial
question but i've tried looking up some stuff on this.

any help much appreciated....
 
Amit,

Right click the textbox, view code and paste this in

Private Sub TextBox1_AfterUpdate()
TextBox1.Text = Format(TextBox1.Text, "###,###" & "$")
End Sub

The format is updated when you click out of the text box.

Mike
 
hi MIke - thx for the response......only one question though...will this work
if i put this into the userform initialize sub so when the form is displayed
it has the text formatted ?
 
hi - htis doesnt seem to wrok when i put thsi in the userform initialize
sub.....any particular reasons?
 
Back
Top