Create a table with two columns, with company practice in the first and code numbers in the second. Name the first column List1 and name the second column List2.
This assumes that the cells where you want the entries are "company practice" to the left of "code number". Use DV with the list option on the two cells, with =List1 as the source on the first, and =List2 on the second.
Then:
1) Copy this code.
2) Right-Click the sheet tab of interest.
3) Select "View Code"
4) Paste the code into the window that appears.
5) Save the file as a macro-enabled .xlsm file.
6) Make changes as needed
Private Sub Worksheet_Change(ByVal Target As Range)
Dim v As Variant
v = Application.Match(Target.Value, Range("List1"), False)
If Not IsError(v) Then
Application.EnableEvents = False
Target.Offset(0, 1).Value = Range("List2").Cells(v).Value
Application.EnableEvents = True
Exit Sub
End If
v = Application.Match(Target.Value, Range("List2"), False)
If Not IsError(v) Then
Application.EnableEvents = False
Target.Offset(0, -1).Value = Range("List1").Cells(v).Value
Application.EnableEvents = True
End If
End Sub
Bookmarks