Data Validation

Stephen_IV

Well-known Member
Joined
Mar 17, 2003
Messages
1,177
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
I have been trying to research this but can not get anything to work. I am trying to use a data validation list that shows 1 thing but puts another thing in the cell.

For instance I would like to see A in the validation list but when I click A the cell value shows 111.

Hope this makes sense.

For example:
A = 111
B = 222
C = 333
D = 444
E = 555
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Data Validation doesn't work that way. But you can put a formula in the cell next to the DV cell that does a lookup function to get the converted value.
 
Upvote 0
Yes, if you want to go that route. Open a copy of your workbook. On the sheet with the DV cell on it, right click the sheet tab and select View Code. Paste this code in the window that opens:

Rich (BB code):
Sub worksheet_Change(ByVal target As Range)


    If Intersect(target, Range("F1")) Is Nothing Then Exit Sub
    Application.EnableEvents = False
    Select Case target.Value
        Case "A": target.Value = 111
        Case "B": target.Value = 222
        Case "C": target.Value = 333
        Case "D": target.Value = 444
        Case "E": target.Value = 555
    End Select
    Application.EnableEvents = True
End Sub
Change the F1 to the cell where your DV is. Press Alt-Q to close the editor. Try it out.
 
Upvote 0

Forum statistics

Threads
1,223,744
Messages
6,174,253
Members
452,553
Latest member
red83

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