English

How To: Capitalize the first letter of a text or string field

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.