Limit Characters Shown in a text box

  • Thread starter Thread starter jamie
  • Start date Start date
J

jamie

Ok...any brainiacs out there!?

I have a userform in excel...
Each Text Box shows a value that is calculated elsewhere within the
spreadsheet...
with the following VB: Me.TxtNamOEM.Text = Range("D15").Value

The value is a calculated value (again taken from the spreadsheet -
the userform acts as a convenient viewer only!).

But the number shows 58.6666666667 (for example) and I want it to only
show 58.67...I have tried changing the Max length property of the text
box (TxtNamOEM) but this doesn't work.

Can anyone help? Thanks in advance

Jamie
 
Ok...any brainiacs out there!?

I have a userform in excel...
Each Text Box shows a value that is calculated elsewhere within the
spreadsheet...
 with the following VB: Me.TxtNamOEM.Text = Range("D15").Value

The value is a calculated value (again taken from the spreadsheet -
the userform acts as a convenient viewer only!).

But the number shows 58.6666666667 (for example) and I want it to only
show 58.67...I have tried changing the Max length property of the text
box (TxtNamOEM) but this doesn't work.

Can anyone help? Thanks in advance

Jamie

Try changing "Me.TxtNamOEM.Text = Range("D15").Value " to
"Me.TxtNamOEM.Text = Format(Range("D15").Value, "0.00")"

Cheers
 
Back
Top