How to Check If the First Letter is capitalized

This post explains that how to check if the first letter in a cell is capitalized or not in excel. How to write an excel Macro to check if the first letter in a specified cell is capitalized or not. How to test if the first letter in a table cell is capitalized with VBA macro in excel. How to capitalize the first letter in a cell with Excel formula.

Check if the first letter is or not capitalized

To check if the first letter in a text string is or not capitalized, you can write an Excel macro to achieve it. So you can follow the below steps to check the first letter:

1# click on “Visual Basic” command under DEVELOPER Tab.

Get the position of the nth using excel vba1

2# then the “Visual Basic Editor” window will appear.

3# click “Insert” ->”Module” to create a new module

convert column number to letter3

4# paste the below VBA code into the code window. Then clicking “Save” button.

check if first letter capitalized1

Sub TestFirstLetterUpper()
    Dim xRg As Range
    Dim xAsc As Integer
    Set xRg = Range("B1")
    xAsc = Asc(Mid(xRg.Value, 1, 1))
    If xAsc > 64 And xAsc < 91 Then
        MsgBox "The first letter in Cell B1 is capitalized."
    Else
        MsgBox " The first letter in Cell B1 is not capitalized "
    End If
End Sub

This VBA code will check if the first letter in Cell B1 is capitalized or not. So you just need to change it to other cells or range as you need.

Or you can use another VBA Macro to achieve the same result:

Sub TestFirstLetterUpper2()
    var1 = "B1"
    If UCase(Left(var1, 1)) = Left(var1, 1) Then
        MsgBox "First letter capitalized"
    Else
        MsgBox "First letter not capitalized"
    End If
End Sub

5# back to the current worksheet, then run the above excel macro.

check if first letter capitalized2

check if first letter capitalized2

Capitalize the first letter in a Cell

Normally, it is very easy to capitalize all letters in a cell in excel, you just need to use the PROPER function to convert it.

=PROPER(B1)

capitalized first letter1

If you want to capitalize only the first letter in a cell, you can create an excel formula based on the REPLACE function, the UPPER function and the LEFT function.

Assuming that you’d like to capitalize the first letter in a first word in Cell B1, then you can write down the following formula:

=REPLACE(B1,1,1, UPPER(LEFT(B1,1)))

check if first letter capitalized4

You can also use another excel formula to achieve the same result as follows:

=CONCATENATE(UPPER(LEFT(B1,1)), RIGHT(B1,LEN(B1)-1))

check if first letter capitalized5


Related Functions

  • Excel LEN function
    The Excel LEN function returns the length of a text string (the number of characters in a text string).The LEN function is a build-in function in Microsoft Excel and it is categorized as a Text Function.The syntax of the LEN function is as below:= LEN(text)…
  • Excel RIGHT function
    The Excel RIGHT function returns a substring (a specified number of the characters) from a text string, starting from the rightmost character.The syntax of the RIGHT function is as below:= RIGHT (text,[num_chars])…
  • Excel Replace function
    The Excel DATE function returns the serial number for a date.The syntax of the DATE function is as below:= DATE (year, month, day) …
  • Excel LEFT function
    The Excel LEFT function returns a substring (a specified number of the characters) from a text string, starting from the leftmost character.The LEFT function is a build-in function in Microsoft Excel and it is categorized as a Text Function.The syntax of the LEFT function is as below:= LEFT(text,[num_chars])…t)…
  • Excel UPPER function
    The Excel UPPER function converts all characters in text string to uppercase.The UPPER function is a build-in function in Microsoft Excel and it is categorized as a Text Function.The syntax of the UPPER function is as below:= UPPER (text)…
  • Excel Proper Function
    The Excel PROPER function capitalizes the first character in each word of a text string and set other characters to lowercase. The syntax of the PROPER function is as below:= PROPER  (text)…
  • Excel Concat function
    The excel CONCAT function combines 2 or more strings or ranges together.This is a new function in Excel 2016 and it replaces the CONCATENATE function.The syntax of the CONCAT function is as below:=CONCAT (text1,[text2],…)…
Related Posts

VBA Macro For VLOOKUP From Another Sheet
vba macro for vlookup from another sheet1

In the previous post, you should know that how to fix or remove the #N/A error when using VLOOKUP formula to lookup value from another sheet. And this post will show you how to use VBA code to vlookup data ...

How To Insert Comments in Protected Worksheet in Excel
insert commetns in protected workshee3

This post will show you how to allow comments in a protected worksheet in Excel. You can easily to insert comments into cells in a normal worksheet in Excel, but if want to insert a comment in a worksheet that ...

How To Convert Text to Upper Cases(Using VBA) in Excel
convert text to upper cases1

This post will show you how to switch from lower case to upper case in Excel. and I am going to show you two different ways of converting text to upper cases using formula or VBA macro in Excel 2013,Excel ...

How To Hide Every Other Row in Excel (Using VBA)
hide every other row1

This post will show you how to hide alternate rows or columns in Excel or how to hide every third, fourth, fifth row or column in Excel. If you want to hide every other row in your current worksheet, how ...

How to Disable the Save As Prompt in Excel
disable save as prompt1

This post will show you how to use a VBA Macro to save an Excel file and overwrite any existing file without a prompt so that you are going to get the little window that says file already exists do ...

How to Count Cells that Contain even or odd numbers in Excel
count cells that contain even numbers5

This post will guide you how to count the number of cells that contain odd or even numbers within a range of cells using a formula in Excel 2013/2016.How do I count cells that contain odd numbers through the use ...

How to Count Cells that Contain negative Numbers in Excel

This post will guide you how to count the number of cells that contain negative numbers within a range of cells using a formula in Excel 2013/2016.You can count the number of negative numbers in your data using easy functions ...

How to Count Cells Are Not Blank or Empty in Excel
count non blank nonempty cells5

This post will guide you how to count cells that are not blank or empty in a given range cells using a formula in Excel 2013/2016.How do I count the number of cells that are not blank in a particular ...

How to Count Cells Not equal to X or Y in Excel
count cells not equals to x or y2

This post will guide you how to count the number of cells not equal to criteria X or Y in a given range cells using a formula in Excel 2013/2016.You can easily to count cells equal to or not equal ...

How to Count Cells Less Than a Specific Value in Excel
count cells lessr than5

This post will guide you how to count the number of cells less than a particular numeric value in a given range cells using a formula in Excel 2013/2016. How do I count cells that are less than a specific ...

Sidebar