View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
beginner beginner is offline
external usenet poster
 
Posts: 2
Default userform & textboxes

hi mr. phillips.

i found in excels' vba help the next tip:

valor = Application.WorksheetFunction.VLookup(numero,
serv, 79, false)
frmResultado.txt1.Value = FormatCurrency(valor, 2)

it works but i've had some troubles when the cell's format
doesn't match with the FormatXXXXX function. (XXXXX =
Currency, Number,TimeDate, Percent)

any suggestion?

tia.

-----Original Message-----

Private Sub TextBox1_AfterUpdate()
With Me.TextBox1
.Value = Format(.Value, "$#,##0.00")
End With
End Sub

Private Sub TextBox2_AfterUpdate()
With Me.TextBox2
.Value = Format(.Value, "dd-mmm-yyyy")
End With
End Sub

Private Sub TextBox3_AfterUpdate()
With Me.TextBox3
.Value = Format(.Value, "0%")
End With
End Sub



--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"beginner" wrote in

message
...
hi!
i've made an userform which has several textboxes. i

need
to give to the textboxes some format.
for example:
textbox1 has to be currency format
textbox2 has to be date format
textbox3 has to be percent format
how can i do this?
tia.




.