Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default userform & textboxes

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.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default userform & textboxes


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.




  #3   Report Post  
Posted to microsoft.public.excel.programming
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.




.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default userform & textboxes

That is when you could use the custom formats as I suggested.

--

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 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.




.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UserForm TextBoxes Rob Excel Discussion (Misc queries) 2 August 6th 05 03:07 AM
Multiple ComboBoxes and TextBoxes on Userform Rich J Excel Programming 6 January 27th 04 07:51 PM
userform textboxes again Jo[_6_] Excel Programming 4 October 21st 03 07:25 PM
userform textboxes Jo[_6_] Excel Programming 4 October 21st 03 07:15 PM
add numbers in textboxes on userform KimberlyC Excel Programming 5 September 18th 03 06:15 AM


All times are GMT +1. The time now is 12:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"