Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Upper case 1st letter only

This is for when the value of a textbox is pasted.
I know that
Application.Selection.Value = UCase(TextBox2.Text)
will result in all caps. Is there a variation of the code that will
result in just the1st letter being in caps?
I searched but could not find any reference to this.
Thanks
jeff
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Upper case 1st letter only

Hi

You can use the worksheetfunction 'Proper' like this:

Application.Selection.Value = WorksheetFunction.Proper(TextBox2.Text)

Regards,
Per

"jeff" skrev i meddelelsen
...
This is for when the value of a textbox is pasted.
I know that
Application.Selection.Value = UCase(TextBox2.Text)
will result in all caps. Is there a variation of the code that will
result in just the1st letter being in caps?
I searched but could not find any reference to this.
Thanks
jeff


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Upper case 1st letter only

If you really mean only the first letter should be in caps and all the rest
of the letters in lower case...

Selection.Value = UCase(Left(TextBox2.Text, 1) & LCase(Mid(TextBox2.Text,2)

--
Rick (MVP - Excel)


"jeff" wrote in message
...
This is for when the value of a textbox is pasted.
I know that
Application.Selection.Value = UCase(TextBox2.Text)
will result in all caps. Is there a variation of the code that will
result in just the1st letter being in caps?
I searched but could not find any reference to this.
Thanks
jeff


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Upper case 1st letter only

On Sep 14, 2:28*pm, "Per Jessen" wrote:
Hi

You can use the worksheetfunction 'Proper' like this:

Application.Selection.Value = WorksheetFunction.Proper(TextBox2.Text)

Regards,
Per

"jeff" skrev i ...



This is for when the value of a textbox is pasted.
I know that
Application.Selection.Value = UCase(TextBox2.Text)
will result in all caps. Is there a variation of the code that will
result in just the1st letter being in caps?
I searched *but could not find any reference to this.
Thanks
jeff- Hide quoted text -


- Show quoted text -


Thanks!
Works just right.
I played around with it myself, but I just couldn't get it the syntax
right. I appreaciate the help.
j.o.
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Upper case 1st letter only

You can use the VBA function StrConv(). Try

Msgbox StrConv("jeff & jacob skaria",vbProperCase )

If this post helps click Yes
---------------
Jacob Skaria


"jeff" wrote:

On Sep 14, 2:28 pm, "Per Jessen" wrote:
Hi

You can use the worksheetfunction 'Proper' like this:

Application.Selection.Value = WorksheetFunction.Proper(TextBox2.Text)

Regards,
Per

"jeff" skrev i ...



This is for when the value of a textbox is pasted.
I know that
Application.Selection.Value = UCase(TextBox2.Text)
will result in all caps. Is there a variation of the code that will
result in just the1st letter being in caps?
I searched but could not find any reference to this.
Thanks
jeff- Hide quoted text -


- Show quoted text -


Thanks!
Works just right.
I played around with it myself, but I just couldn't get it the syntax
right. I appreaciate the help.
j.o.

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
Upper Case Letters to First Letter Upper, Remaining Letters Lower SueW Excel Discussion (Misc queries) 7 February 25th 10 05:32 PM
1st letter upper case ZIPPOMA NEEDS HELP Excel Discussion (Misc queries) 5 October 15th 08 03:58 AM
lower case letter "i" always converts to upper case Carolyn Excel Discussion (Misc queries) 1 August 28th 08 01:56 AM
How do I change Letter case (lower to Upper) in a spreadsheet??? mineisjosh Excel Discussion (Misc queries) 4 February 20th 05 01:49 AM
Excel Format Cell - first letter upper case i8theburger Excel Programming 9 April 19th 04 10:57 PM


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