Create label expressions using VBScript


This article contains some syntax examples for creating common label expressions using VBScript. Enter these expressions in the ArcMap Label Expression dialog box.


The content in this article pertains to ArcGIS versions 8.x and 9.x. Later versions of ArcGIS may contain different functionality, as well as different names and locations for menus, commands and geoprocessing tools.
  1. Open the Label Expression dialog box in ArcMap.
[O-Image] ArcMap Label Expression dialog box
 At ArcGIS Desktop versions 8.2 and later, click the Help button on the Label Expression dialog box to display more help on advanced label expressions. 
  1. Use an ampersand (&) to append a text string to the Label Field.
"Name: " & [Name]
[O-Image] append text to a label
  1. Use the UCase function to convert the Label Field to upper case.
[O-Image] Label Expression using Upper Case
  1. Create a multiple-line label using the VbNewLine keyword.
"Name: " & [Name] & vbNewLine & "Type: " &  [Type] 
[O-Image] Label Expression using VbNewLine
  1. Use the FormatCurrency function to display the Label as currency.
"Occupancy Revenue: " & FormatCurrency( [Maximum_Oc] * [Rate])
[O-Image] Label Expression using Currency
  1. Use the FormatNumber function to display labels for numeric items with trailing zeros.
"Occupancy: " & FormatNumber([OCCUPANCY_RATE],3) 
[O-Image] Label Expression with trailing zeros

Article ID:000002553

  • ArcMap 9 x
  • ArcMap 8 x

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic