Make the First letter Capital

Yadlik

New Member
Joined
May 8, 2002
Messages
40
This is probably a simple question, but I have searched the archives and cannot find the answer... How can I make the first letter of every work a capital letter?

Thanks for any help!
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
You could try putting this in the worksheet's code module :-

Private Sub Worksheet_Change(ByVal Target As Range)
Dim cell As Range
For Each cell In Target
If cell.HasFormula = False Then
cell.Value = StrConv(cell.Value, vbProperCase)
End If
Next cell
End Sub
This message was edited by ldry on 2002-05-20 17:21

I am using this in an excel 2010 document, but I get a debug error. It is because I am also using the following code. I just cannot figure out how to fix the range on the above code.

Application.EnableEvents = False
If Not Application.Intersect(Target, Range("H6:H69,M6:M69,R6:R69,W6:W69,AB6:AB69,AG6:AG69,AL6:AL69,AQ6:AQ69")) Is Nothing Then
Target(1).Value = UCase(Target(1).Value)
End If
Application.EnableEvents = True


I am using this in a schedule for work, and these target cells are all capital. I need the next 3 cells after these above listed cells to be Proper case for Employee names.

Example:
A6 B6 C6
TEST COMPANY Employee Name1 Employee Name2

When I run the above vba code in the excel document, it gives a debug error and points to the target range of the next code for the COMPANY. After I close the debug, the code for the Employee works.

Any clue on how to fix?
 
Upvote 0
I am using this in an excel 2010 document, but I get a debug error. It is because I am also using the following code. I just cannot figure out how to fix the range on the above code.

Application.EnableEvents = False
If Not Application.Intersect(Target, Range("H6:H69,M6:M69,R6:R69,W6:W69,AB6:AB69,AG6:AG69,AL6:AL69,AQ6:AQ69")) Is Nothing Then
Target(1).Value = UCase(Target(1).Value)
End If
Application.EnableEvents = True


I am using this in a schedule for work, and these target cells are all capital. I need the next 3 cells after these above listed cells to be Proper case for Employee names.

Example:
A6 B6 C6
TEST COMPANY Employee Name1 Employee Name2

When I run the above vba code in the excel document, it gives a debug error and points to the target range of the next code for the COMPANY. After I close the debug, the code for the Employee works.

Any clue on how to fix?

Was able to figure it out.
 
Upvote 0

Forum statistics

Threads
1,214,950
Messages
6,122,428
Members
449,083
Latest member
Ava19

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