Untitled
4 years ago in Plain Text
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"
abc = "Alabama"
Case "AK"
abc = "Alaska"
Case "AZ"
abc = "Arizona"
Case "AR"
abc = "Arkansas"
Case "CA"
abc = "California"
Case "CO"
abc = "Colorado"
Case "CT"
abc = "Connecticut"
Case "DE"
abc = "Delaware"
Case "FL"
abc = "Florida"
Case "GA"
abc = "Georgia"
Case "HI"
abc = "Hawaii"
Case "ID"
abc = "Idaho"
Case "IL"
abc = "Illinois"
Case "IN"
abc = "Indiana"
Case "IA"
abc = "Iowa"
Case "KS"
abc = "Kansas"
Case "KY"
abc = "Kentucky"
Case "LA"
abc = "Louisiana"
Case "ME"
abc = "Maine"
Case "MD"
abc = "Maryland"
Case "MA"
abc = "Massachusetts"
Case "MI"
abc = "Michigan"
Case "MS"
abc = "Mississippi"
Case "MO"
abc = "Missouri"
Case "MN"
abc = "Minnesota"
Case "MT"
abc = "Montana"
Case "NE"
abc = "Nebraska"
Case "NV"
abc = "Nevada"
Case "NH"
abc = "New Hampshire"
Case "NJ"
abc = "New Jersey"
Case "NM"
abc = "New Mexico"
Case "NY"
abc = "New York"
Case "NC"
abc = "North Carolina"
Case "ND"
abc = "North Dakota"
Case "OH"
abc = "Ohio"
Case "OK"
abc = "Oklahoma"
Case "OR"
abc = "Oregon"
Case "PA"
abc = "Pennsylvania"
Case "RI"
abc = "Rhode Island"
Case "SC"
abc = "South Carolina"
Case "SD"
abc = "South Dakota"
Case "TN"
abc = "Tennessee"
Case "TX"
abc = "Texas"
Case "UT"
abc = "Utah"
Case "VT"
abc = "Vermont"
Case "VA"
abc = "Virginia"
Case "WA"
abc = "Washington"
Case "WV"
abc = "West Virginia"
Case "WI"
abc = "Wisconsin"
Case "WY"
abc = "Wyoming"
Case else
abc = cells
End Select
End Function