HOW TO

Capitalize the first letter of a text or string field in ArcGIS Desktop 10.x

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 an attribute table.

Warning:
This workflow and code sample only works for versions 10.x or later. This is because ArcGIS no longer supports VBA at Version 10. For 9.3.1 and earlier, please see the link in the Related Information section.

Procedure



  1. In ArcMap, open the attribute table of a layer by right-clicking the layer in the Table of Contents and clicking Open Attribute Table.
  2. Right-click a field heading of a field that is to be edited. Click Field Calculator.
    Note:
    Optionally, create a new text field for the result by clicking the Options button in the top left of the attribute table and selecting Add Field.

  3. When the Field Calculator window appears, choose VB Script as the Parser type and select Show Codeblock.
  4. Copy the following code into the Pre-Logic Script Code box.
    Code:
    Dim sUpperC
    sUpperC = LEFT( [FIELD_NAME], 1)

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

    Dim Output

    Output = UCASE(sUpperC) & sLowerC

  5. In the code, change [FIELD_NAME] to the name of the field in which to capitalize the first letter.
  6. Beneath the Pre-Logic Script Code box is another box labeled with the field name chosen in Step 5, followed by "=". In this box type "Output". In the image below it is TextList =.
    [O-Image] Field calculator screen shot
  7. Click OK.

Article ID:000011643

Software:
  • ArcMap

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic