can i type a number for a specific name to appear in the cell?

F

FC

I got a list of names related to 4 digit number that I memorized. It is
possible to write a formula or anyway that if I write the number in a cell (
ex.123 in A2) instead of the number, the name Luis will appear in that same
cell ( A2). Tx
 
G

Gord Dibben

Either through using AutoCorrect by building a list or by VBA event code.

Would be much easier to use a helper column and a VLOOKUP formula.

Use Data Validation for in-cell drop-down for selecting a number and VLOOKUP
for the filling-in part.

See Debra Dalgleish's site for more on VLOOKUP and Data
Validation lists for entering the choices.

http://www.contextures.on.ca/xlFunctions02.html

http://www.contextures.on.ca/xlDataVal01.html

Note the section on using DV lists from another worksheet by naming the list.


Gord Dibben MS Excel MVP
 
D

Don Guillett

Several ways. Right click sheet tab>view code>insert this. Works for cell
c15 as written.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$C$15" Then
Application.EnableEvents = False
Select Case Target
Case Is = 123: x = "Joe"
Case Is = 345: x = "bill"
Case Else: x = "not here"
End Select
Target.Value = x
Application.EnableEvents = True
End If
End Sub
 
Top