VBA check if first letter is capital

Dimitris254

Board Regular
Joined
Apr 25, 2016
Messages
139
Hi all,

I would like to go through a column with names and check if the first letter is capital (English characters/alphabet used in the worksheet).

I've found this thread, but i think it's only for 1 string (i want to go through all cells in column B).


Thank you in advance :)
 
Something else to consider if the values are being entered manually is to try to force the correct entry in the first place with a Data Validation custom formula applied to column B

=EXACT(B1,PROPER(B1))
thank you for the info, unfortunately i'm not the owner of the document - but i have to fix it before using it...

i'll keep this in mind though for my docs :)
 
Upvote 0
Might as well throw this in too

Code:
Sub t()
Dim c As Range
    With ActiveSheet
        For Each c In .Range("B2", .Cells(Rows.Count, 2).End(xlUp))
            txt = StrConv(c.Text, vbProperCase)
            c.Value = txt
        Next
    End With
End Sub

after testing this a little more, i noticed that it the Proper function will decapitalise (as it should) some names, e.g. Peter-Georg will turn into Peter-georg

which i wonder why is the reason, since Rick is also using Proper :confused:
 
Upvote 0
after testing this a little more, i noticed that it the Proper function will decapitalise (as it should) some names, e.g. Peter-Georg will turn into Peter-georg

which i wonder why is the reason, since Rick is also using Proper :confused:
StrConv( ,vbProperCase) and the worksheet function PROPER() do not behave exactly the same. You have found an example of that fact.
 
Last edited:
Upvote 0
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