View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default textbox formatting questions

Hi Rook,

Where did you put the code?

I tried using a CommandButton or the TextBox's Exit event:

'=============
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
With TextBox1
.Value = StrConv(.Value, vbProperCase)
'Or
.Value = Format(.Value, "dd/mm/yy")
End With
End Sub
'<<=============


---
Regards,
Norman



"Rook" wrote in message
...
Hi Norman.

I tried what you suggested but everytime I key in the second character the
textbox automatically formats it. Did I miss anything in the property?

Thanks

Rook

"Norman Jones" wrote:

Hi Rook,

Try:

With TextBox1
.Value = StrConv(.Value, vbProperCase)
'Or
.Value = Format(.Value, "dd/mm/yy")
End With

I am not aware of a telehone number format, certainly, but you can use a
custom format of your choice


---
Regards,
Norman



"Rook" wrote in message
...
Hi!
How do you do the ff:
1. Format a textbox such that the text begins with a capital letter and
the
rest are in small caps?
2. Format a textbox such that it follows the telephone number format?
3. Date format?

Need your help.

Rook