PDA

View Full Version : Solved: Userform Text Field Format



hobbiton73
01-30-2013, 09:24 AM
Hi, I wonder whether someomne may be able to help me please.

I'm using the code below to perform a calculation in a text field on a userform.

Private Sub inputhours_Change()
outputmandays.Value = CStr(Val(inputhours.Value) / 7.4)
End Sub

The code works fine, but I'd like the format of my text field 'outputmandays' to be '0.00'.

I've been trying to find a solution for this, this afternoon, but I've been unable to do so.

I just wondered whether someone may be able to take a look at this please and offer some guidance on how I may go about achieving ths.

Many thanks and kind regards

Chris

Kenneth Hobs
01-30-2013, 09:49 AM
outputmandays.Value = Format(Val(inputhours.Value) / 7.4, "0.00")

Bob Phillips
01-30-2013, 09:49 AM
outputmandays.Value = Format(Val(inputhours.Value) / 7.4, "0.00")

hobbiton73
01-31-2013, 09:52 AM
Hi @xld, thank you very much for taking the time to reply to my post. The solution works great.

Kind regards

Chris

hobbiton73
01-31-2013, 09:54 AM
Hi @Kenneth Hobs, thank you very much for taking the time to reply to my post. I really appreciate it. The solution works great.

Kind regards

Chris