For each one, you need to change this:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim v As Variant
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Range("C16:C29")) Is Nothing Then Exit Sub 'specific range
'Turn off events to keep out of loops
Application.EnableEvents = False
v = Application.Match(Target.Value, Worksheets("Lists").Range("B:B"), False)
If Not IsError(v) Then
Target.Value = Worksheets("Lists").Range("A:A").Cells(v).Value
End If
'Turn events back on to get ready for the next change
Application.EnableEvents = True
End Sub
To this:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim v As Variant
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("C16:C29")) Is Nothing Then ' Exit Sub 'specific range
'Turn off events to keep out of loops
Application.EnableEvents = False
v = Application.Match(Target.Value, Worksheets("Lists").Range("B:B"), False)
If Not IsError(v) Then
Target.Value = Worksheets("Lists").Range("A:A").Cells(v).Value
End If
'Turn events back on to get ready for the next change
Application.EnableEvents = True
End If
End Sub
And combine into one event handler.
You will only need this once:
Dim v As Variant
If Target.Cells.Count > 1 Then Exit Sub
Bookmarks