av8tordude
04-08-2011, 03:51 PM
Can someone assist with creating a code that will run the code below on a workbook-B. Thanks
Sub Abbreviation2States()
Dim c As Range
For Each c In ActiveSheet.Range("A:A")
Select Case UCase(c)
Case "AL"
c = "Alabama"
Case "AZ"
c = "Arizona"
Case "AR"
c = "Arkansas"
Case "CA"
c = "California"
Case "CO"
c = "Colorado"
Case "CT"
c = "Connecticut"
Case "DE"
c = "Delaware"
Case "DC"
c = "DISTRICT OF COLUMBIA"
Case "FL"
c = "Florida"
Case "GA"
c = "Georgia"
Case "ID"
c = "Idaho"
Case "IL"
c = "Illinois"
Case "IN"
c = "Indiana"
Case "IA"
c = "Iowa"
Case "KS"
c = "Kansas"
Case "KY"
c = "Kentucky"
Case "LA"
c = "Louisiana"
Case "ME"
c = "Maine"
Case "MD"
c = "Maryland"
Case "MA"
c = "Massachusetts"
Case "MI"
c = "Michigan"
Case "MN"
c = "Minnesota"
Case "MS"
c = "Mississippi"
Case "MO"
c = "Missouri"
Case "MT"
c = "Montana"
Case "NE"
c = "Nebraska"
Case "NV"
c = "Nevada"
Case "NH"
c = "New Hampshire"
Case "NJ"
c = "New Jersey"
Case "NM"
c = "New Mexico"
Case "NY"
c = "New York"
Case "NC"
c = "North Carolina"
Case "ND"
c = "North Dakota"
Case "OH"
c = "Ohio"
Case "OK"
c = "Oklahoma"
Case "OR"
c = "Oregon"
Case "PA"
c = "Pennsylvania"
Case "RI"
c = "Rhode Island"
Case "SC"
c = "South Carolina"
Case "SD"
c = "South Dakota"
Case "TN"
c = "Tennessee"
Case "TX"
c = "Texas"
Case "UT"
c = "Utah"
Case "VT"
c = "Vermont"
Case "VA"
c = "Virginia"
Case "WA"
c = "Washington"
Case "WV"
c = "West Virginia"
Case "WI"
c = "Wisconsin"
Case "WY"
c = "Wyoming"
End Select
Next c
End Sub
Sub Abbreviation2States()
Dim c As Range
For Each c In ActiveSheet.Range("A:A")
Select Case UCase(c)
Case "AL"
c = "Alabama"
Case "AZ"
c = "Arizona"
Case "AR"
c = "Arkansas"
Case "CA"
c = "California"
Case "CO"
c = "Colorado"
Case "CT"
c = "Connecticut"
Case "DE"
c = "Delaware"
Case "DC"
c = "DISTRICT OF COLUMBIA"
Case "FL"
c = "Florida"
Case "GA"
c = "Georgia"
Case "ID"
c = "Idaho"
Case "IL"
c = "Illinois"
Case "IN"
c = "Indiana"
Case "IA"
c = "Iowa"
Case "KS"
c = "Kansas"
Case "KY"
c = "Kentucky"
Case "LA"
c = "Louisiana"
Case "ME"
c = "Maine"
Case "MD"
c = "Maryland"
Case "MA"
c = "Massachusetts"
Case "MI"
c = "Michigan"
Case "MN"
c = "Minnesota"
Case "MS"
c = "Mississippi"
Case "MO"
c = "Missouri"
Case "MT"
c = "Montana"
Case "NE"
c = "Nebraska"
Case "NV"
c = "Nevada"
Case "NH"
c = "New Hampshire"
Case "NJ"
c = "New Jersey"
Case "NM"
c = "New Mexico"
Case "NY"
c = "New York"
Case "NC"
c = "North Carolina"
Case "ND"
c = "North Dakota"
Case "OH"
c = "Ohio"
Case "OK"
c = "Oklahoma"
Case "OR"
c = "Oregon"
Case "PA"
c = "Pennsylvania"
Case "RI"
c = "Rhode Island"
Case "SC"
c = "South Carolina"
Case "SD"
c = "South Dakota"
Case "TN"
c = "Tennessee"
Case "TX"
c = "Texas"
Case "UT"
c = "Utah"
Case "VT"
c = "Vermont"
Case "VA"
c = "Virginia"
Case "WA"
c = "Washington"
Case "WV"
c = "West Virginia"
Case "WI"
c = "Wisconsin"
Case "WY"
c = "Wyoming"
End Select
Next c
End Sub