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

Is it possable to capitalize the first letter of an users input as it is
entered into text box that is on a combo box, by useing code
thanks in advance



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Capitalize input


"Nalla" wrote in message
...
Is it possable to capitalize the first letter of an users input as it is
entered into text box that is on a combo box, by useing code
thanks in advance


SoOORY Mean NOT Userform not combobox



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Capitalize input

There are no proper case commands in Excel (unlike Word). But you could
convert the value using the following construct

x = UCase(Mid(x, 1, 1)) & Mid(x, 2)

where x is the string to act upon.

To apply this to a textbox, use the change event

Private Sub TextBox1_Change()
TextBox1.Value = UCase(Mid(TextBox1.Value, 1, 1)) & Mid(TextBox1.Value, 2)
End Sub

--
Cheers
Nigel



"Nalla" wrote in message
...

"Nalla" wrote in message
...
Is it possable to capitalize the first letter of an users input as it is
entered into text box that is on a combo box, by useing code
thanks in advance


SoOORY Mean NOT Userform not combobox





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 747
Default Capitalize input

If you mean captialize first letter of input into text box on userform then
try:

Private Sub TextBox1_Change()
With TextBox1
If Len(.Text) = 1 Then .Text = UCase(.Text)
End With
End Sub

Regards,
Greg

"Nalla" wrote:

Is it possable to capitalize the first letter of an users input as it is
entered into text box that is on a combo box, by useing code
thanks in advance




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Capitalize input

Nalla wrote:
Is it possable to capitalize the first letter of an users input as it
is entered into text box that is on a combo box, by useing code
thanks in advance


Another way is to change the text after the user is done typing, like

Private Sub TextBox1_AfterUpdate()

Me.TextBox1.Text = StrConv(Me.TextBox1.Text, vbProperCase)

End Sub

This will change the text to proper case, rather than just capitalizing the
first letter. You may prefer this method if you want to prevent the user
from typing in all caps.

--
Dick Kusleika
Excel MVP
Daily Dose of Excel
www.dicks-blog.com


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
capitalize first letter rodchar Excel Discussion (Misc queries) 14 December 19th 08 01:47 PM
Capitalize text when input in cell shamor Excel Discussion (Misc queries) 1 May 21st 08 04:21 PM
Capitalize officegirl Excel Discussion (Misc queries) 2 November 30th 07 04:35 AM
capitalize ideal Excel Discussion (Misc queries) 1 September 13th 07 03:03 PM
Capitalize text Eddie Excel Discussion (Misc queries) 2 February 8th 05 09:19 PM


All times are GMT +1. The time now is 03:11 PM.

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

About Us

"It's about Microsoft Excel"