Untitled
4 years ago in VB.NET
Sub GetStateNames()
Dim cell As Range
For Each cell In Range("j:j")
If cell.Value <> "" Then
cell.Value = abc(cell.Value)
End If
Next cell
End Sub
Function abc(cells)
Select cell
Case "AL"
return "Alabama"
Case "AK"
return "Alaska"
Case "AZ"
return "Arizona"
Case "AR"
return "Arkansas"
Case "CA"
return "California"
Case "CO"
return "Colorado"
Case "CT"
return "Connecticut"
Case "DE"
return "Delaware"
Case "FL"
return "Florida"
Case "GA"
return "Georgia"
Case "HI"
return "Hawaii"
Case "ID"
return "Idaho"
Case "IL"
return "Illinois"
Case "IN"
return "Indiana"
Case "IA"
return "Iowa"
Case "KS"
return "Kansas"
Case "KY"
return "Kentucky"
Case "LA"
return "Louisiana"
Case "ME"
return "Maine"
Case "MD"
return "Maryland"
Case "MA"
return "Massachusetts"
Case "MI"
return "Michigan"
Case "MS"
return "Mississippi"
Case "MO"
return "Missouri"
Case "MN"
return "Minnesota"
Case "MT"
return "Montana"
Case "NE"
return "Nebraska"
Case "NV"
return "Nevada"
Case "NH"
return "New Hampshire"
Case "NJ"
return "New Jersey"
Case "NM"
return "New Mexico"
Case "NY"
return "New York"
Case "NC"
return "North Carolina"
Case "ND"
return "North Dakota"
Case "OH"
return "Ohio"
Case "OK"
return "Oklahoma"
Case "OR"
return "Oregon"
Case "PA"
return "Pennsylvania"
Case "RI"
return "Rhode Island"
Case "SC"
return "South Carolina"
Case "SD"
return "South Dakota"
Case "TN"
return "Tennessee"
Case "TX"
return "Texas"
Case "UT"
return "Utah"
Case "VT"
return "Vermont"
Case "VA"
return "Virginia"
Case "WA"
return "Washington"
Case "WV"
return "West Virginia"
Case "WI"
return "Wisconsin"
Case "WY"
return "Wyoming"
Case else
return cells
End Select
End Function