VBProper for first word in a string

tony.reynolds

Board Regular
Joined
Jul 8, 2010
Messages
97
Code:
Private Sub Description_Change()
        Description.Value = StrConv(Description.Value, vbProperCase)
End Sub

I have this code working fine of previouse post but i want now to do it for the first word in the box on the user form.

"This Is How It Currently Changes It"

"This is how i want to be ABLE to Enter"

just the first letter must be Caps tyhe rest what ever I type.
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Desciption.Value = UCase(left(Description.Value,1)) & right(Description.Value,len(Description.Value)-1)
 
Upvote 0
Great thet works well I had to add On Error Resume Next before because if i tabbed to that cell again changed its value to "" (hit Delete) it had no Characters to edit

thanks
 
Upvote 0
Great thet works well I had to add On Error Resume Next before because if i tabbed to that cell again changed its value to "" (hit Delete) it had no Characters to edit

thanks

How about:

Code:
if not isnull(Desciption.Value) then Desciption.Value = UCase(left(Description.Value,1)) & right(Description.Value,len(Description.Value)-1)

Then you don't need the on error resume next
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top