Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

 How to create drop down list but show different values in Excel?

In Excel worksheet, we can quickly create a drop down list with the Data Validation feature, but, have you ever tried to show a different value when you click the drop down list? For example, I have the following two column data in Column A and Column B, now, I need to create a drop down list with the values in Name column, but, when I select the name from the created drop down list, the corresponding value in Number column is displayed as following screenshot shown. This article will introduce the details to solve this task.

doc dropdown different values 1

Create drop down list but show different value in drop down list cell

Excel Productivity Tools

Office Tab: Bring powerful tabs to Office (include Excel), just like Chrome, Safari, Firefox and Internet Explorer. Save you half the time, and reduce thousands of mouse clicks for you. 30-day Unlimited Free Trial

Kutools for Excel: Save 70% of your time and solve 80% Excel problems for you. 300+ advanced features designed for 1500+ work scenario, make Excel much easy and increase productivity immediately. 60-day Unlimited Free Trial


Create drop down list but show different value in drop down list cell

To finish this task, please do with the following step by step:

1. Create a range name for the cell values you want to use in the drop down list, in this example, I will enter the name dropdown in the Name Box, and then press Enter key, see screenshot:

doc dropdown different values 2

2. Then select cells where you want to insert the drop down list, and click Data > Data Validation > Data Validation, see screenshot:

doc dropdown different values 3

3. In the Data Validation dialog box, under the Settings tab, choose List from the Allow drop down, and then click doc dropdown different values 5 button to select the Name list which you want to use as drop down values in the Source text box. See screenshot:

doc dropdown different values 4

4. After inserting the drop down list, please right click active sheet tab, and select View Code from the context menu, and in the opened Microsoft Visual Basic for applications window, copy and paste the following code into the blank Module:

VBA code: Display different value from the drop down list:

Private Sub Worksheet_Change(ByVal Target As Range)
'Updateby Extendoffice 20161026
    selectedNa = Target.Value
    If Target.Column = 5 Then
        selectedNum = Application.VLookup(selectedNa, ActiveSheet.Range("dropdown"), 2, False)
        If Not IsError(selectedNum) Then
            Target.Value = selectedNum
        End If
    End If
End Sub

doc dropdown different values 6

Note: In the above code, the number 5 within If Target.Column = 5 Then script is the column number that your drop down list located, , the “dropdown” in this selectedNum = Application.VLookup(selectedNa, ActiveSheet.Range("dropdown"), 2, False) code is the range name you have created in step 1. You can change them to your needed.

5. Then save and close this code, now, when you select an item from the drop down list, a relative different value is displayed in the same cell, see screenshot:

doc dropdown different values 7


Demo: Create drop down list but show different values in Excel

Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days. Download and free trial Now!


Excel Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 70%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 80% Excel problems.

  • Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  • Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  • Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  • Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  • No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  • Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  • 60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  • Change the way you work now, and give you a better life immediately!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Marcus · 16 days ago
    How would the code Need to Change if I wanted to create a reference/link in E1 to the source of the Dropdown list based on the selected value?
    The Benefit would be that In case of a change in the dropdown source (e.g. "Henrik" => "Hendrik" the change would automatically get reflected in E1.
  • To post as a guest, your comment is unpublished.
    William · 1 months ago
    In this example, what if you want it to look at a value in each of the cells in 5, but put the value in the adjacent cell in 6
  • To post as a guest, your comment is unpublished.
    ty · 2 months ago
    this doesn't work in current versions of excel- outdated. Data validation then list no longer shows up in vba as an excel object have tried already multiple times and it doesn't show up.
  • To post as a guest, your comment is unpublished.
    Charmin · 1 years ago
    How does the formula work when you want to list the data on a separate sheet/tab in the workbook?
  • To post as a guest, your comment is unpublished.
    Charmin · 1 years ago
    How does the formula the work when you want to add the data on a separate sheet in the workbook? I want to hide the data.
    • To post as a guest, your comment is unpublished.
      Phyo · 6 months ago
      Change here bro!
      selectedNum = Application.VLookup(selectedNa, Worksheets("YourSheetName").Range("dropdown"), 2, False)