I want the ability to create a list using data validation and give it a define name. With this I want a drop down menu that will display a title but once selected give a code. Here is the code I have right now:
Code:
<code>
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then GoTo exitHandler
If Target.Column = 1 Then
If Target.Value = "" Then GoTo exitHandler
Application.EnableEvents = False
Target.Value = Worksheets("DataEntry").Range("A1") _
.Offset(Application.WorksheetFunction _
.Match(Target.Value, Worksheets("DataEntry").Range("Site_Name_ID"), 0), 0)
End If
exitHandler:
Application.EnableEvents = True
Exit Sub
End Sub
<code>
use this code to target columns 1, 2, 3, 4
all on worksheet DataEntry
ranges A1, D1, G1, and J1
Range titles: Site_Name_ID, Grant_Code_ID, Area_od_Info_ID, and Source_Name_ID</code></code>
Last edited by a moderator: