Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default textbox formatting questions

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default textbox formatting questions

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default textbox formatting questions

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




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






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default textbox formatting questions

Hi Norman,

I put the code within a sub - see below (courtesy of Bob Phillips):

Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _
ByVal Shift As Integer)
Dim fBackwards As Boolean
Const ctlPrev As String = "TextBox3"
Const ctlNext As String = "TextBox2"

Select Case KeyCode
Case vbKeyTab, vbKeyReturn, vbKeyDown, vbKeyUp
Application.ScreenUpdating = False
fBackwards = CBool(Shift And 1) Or (KeyCode = vbKeyUp)
If Application.Version < 9 Then ActiveSheet.Range("A1").Select
If fBackwards Then
ActiveSheet.OLEObjects(ctlPrev).Activate
Else
ActiveSheet.OLEObjects(ctlNext).Activate
End If
Application.ScreenUpdating = True
End Select
End Sub


Thanks

Rook


"Norman Jones" wrote:

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






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
Coding questions about UserForm TextBox excelnut1954 Excel Programming 7 January 13th 06 03:02 PM
Textbox questions Stuart[_21_] Excel Programming 6 April 4th 05 10:40 AM
TextBox from Drawing toolbar - 2 questions Stuart[_5_] Excel Programming 2 July 27th 04 06:50 AM
Textbox Properties questions ForSale[_3_] Excel Programming 3 July 20th 04 04:57 AM
2 Textbox questions Martin Koenig Excel Programming 5 April 5th 04 09:13 AM


All times are GMT +1. The time now is 09:52 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"