textbox issue

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can a textbox on a user form be formatted to show x decimal places as i get
5.7 ionstead of 5.70?
 
I have the following sub in the Form Code window (my textbox is named TxtAmt
-- so you need to change below to your textbox name accordingly...)

Private Sub TxtAmt_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
With Me.txtAmt
.Text = Format(.Text, "#,##0.00")
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top