HOW TO

Capitalize the first letter of a text or string field

Last Published: April 25, 2020

Summary

Instructions provided describe how to use the Field Calculator in ArcMap to capitalize the first letter of all the values of a text or string field in the Attribute Table.

Procedure

Follow the steps below.
Note:
The procedure described below is for Version 9.3x and earlier.

  1. In ArcMap, open the Attribute Table of a layer.
  2. Right-click on a field heading of a text field > Calculate Values ...

    Note:
    Optionally, create a new text field for the result by first clicking Options > Add Field.

  3. Click, when the Field Calculator appears, the Advanced checkbox.
  4. Paste the following code in the Pre Logic VBA Script Code box.

    Code:
    Dim sUpperC As String
    sUpperC = LEFT( [FIELD_NAME], 1)

    Dim sLowerC As String
    sLowerC = RIGHT( [FIELD_NAME], LEN( [FIELD_NAME]) - 1)

    Dim Output As String
    Output = UCASE(sUpperC) & sLowerC

  5. Change [FIELD_NAME] to the actual name of the field in which you want to capitalize the first letter.
  6. Type the word 'Output' in the box below the code.
  7. Click OK.

Article ID:000008601

Software:
  • ArcMap 8 x
  • ArcMap 9 x

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic