Drop-down List: Abbreviated in cell

coach_veto

New Member
Joined
Jan 26, 2016
Messages
15
Let's say I have a list of countries in my drop down list. Is it possible to spell them all out in the list but when one is selected, an abbreviated version appears in the cell?

For example, if "United Kingdom" is in my list, when I select "United Kingdom", I want "UK" to appear in the active cell. If there code I can reference to make this possible? (New to VBA & Excel in general)

Thanks!
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Say your list is in J:K (J1 has United Kingdom, K1 has UK, etc.)
Name the data validation cell DVRange (or something)
Right-click the sheet tab, select View Code, paste this in:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = [dvrange].Address Then
Application.EnableEvents = False
[dvrange].Value = Application.VLookup([dvrange].Value, Range("J1:K100"), 2, False)
Application.EnableEvents = True
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,379
Messages
6,124,607
Members
449,174
Latest member
ExcelfromGermany

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top