Check each word in cell has first capital first letter

timspin

Board Regular
Joined
Nov 18, 2002
Messages
231
Hi All

Can any one help - I have a column K with text descriptions in each cell, I want to check each cell and mark it if any of the words in that cell are not capitalized (not including punctuation).

Any ideas how to do this?

Thanks
Tim
 
Probably VBA I would think since you don't want to highlight punctuation.
Do you want to mark them or change them cos if you use PROPER(A1) that would change them and there would be no need to mark them.
 
Upvote 0
Can you post a few examples of what your data looks like?
Are there any numbers?
If there is any punctuation, for any words that appear after that, if there ALWAYS at least one space after the end of the punctuation and before the next word?
 
Upvote 0
Trevor,

You can actually use your solution without having to use a Helper Column. Just amend your Conditional Formatting Formula like this:
Code:
=EXACT(K2,PROPER(K2))=FALSE
 
Upvote 0
Code:
Sub test()

Dim cell As Range


For Each cell In ThisWorkbook.Sheets(1).Range("F2:F6") '<- need to supply your own range


If cell.Value <> UCase(cell.Value) Then
cell.Font.Color = RGB(255, 0, 0)
End If
Next


End Sub
 
Upvote 0
yky,
They are looking for Proper Case (first letter of each word capitalized only), not Ucase (which is all Upper Case).
 
Upvote 0
This function will extract words that are not in Proper format separated by spaces in applied Cell:


Code:
Function CheckCase(txt As String) As String
Dim sp As Variant
sp = Split(txt)
For Each ele In sp
    If AscW(Left(ele, 1)) < 65 Or AscW(Left(ele, 1)) > 90 Then
        strng = ", " & ele & strng
    End If
Next
CheckCase = Mid(strng, 3)
End Function
 
  • Like
Reactions: yky
Upvote 0
yky,
They are looking for Proper Case (first letter of each word capitalized only), not Ucase (which is all Upper Case).
Thank you. I need to learn how to read.
 
Last edited:
Upvote 0
This function will extract words that are not in Proper format separated by spaces in applied Cell:


Code:
Function CheckCase(txt As String) As String
Dim sp As Variant
sp = Split(txt)
For Each ele In sp
    If AscW(Left(ele, 1)) < 65 Or AscW(Left(ele, 1)) > 90 Then
        strng = ", " & ele & strng
    End If
Next
CheckCase = Mid(strng, 3)
End Function
One possible problem with your function... words within parentheses like "One Two (Three Four) Five".
 
Last edited:
Upvote 0

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