HOW TO
You can use VB If/Then statements to selectivley label features. For example, you want to create a stacked label from the Genus, Species, and Subspecies fields and omit empty values from the label.
Code:
Function FindLabel([GENUS],[SPECIES], [SUBSPECIES])
Dim TheLabel
If [GENUS] <> " " Then
TheLabel = "Genus: " & [GENUS]
End If
If [SPECIES] <> " " Then
TheLabel = TheLabel&vbnewline&"Species: " & [SPECIES]
End If
If [SUBSPECIES] <> " " Then
TheLabel = TheLabel&vbnewline&"SubspeciesLabel: " & [SUBSPECIES]
End If
FindLabel = TheLabel
End Function
Note:
You can stack more than three labels. To do this add fields to the "Function FindLabel()" statement. Then add more IF/THEN tests for each additional field.
Get help from ArcGIS experts
Download the Esri Support App