title: How do I combine two private Worksheet_Change subs into one in VBA?
body: <p>I currently have this code :</p>
  
  <pre><code>Private Sub Worksheet_Change(ByVal Target As Range)
  
      Dim lastrow As Long
      Dim rngList As Range
  
      lastrow = Cells(Rows.Count, "A").End(xlUp).Row
  
      Set rngList = Range("AB3").CurrentRegion
  
      If Target.Cells.Count &gt; 1 Then Exit Sub
  
      On Error Resume Next
  
      If Not Intersect(Target, Range("B18:B19")) Is Nothing Then  ' user is in column-A
          Target.Value = Application.WorksheetFunction.VLookup(Target.Value, rngList, 2, False)
      End If
  
      Set rngList = Nothing
  End Sub
  </code></pre>
  
  <p>and </p>
  
  <pre><code>Private Sub Worksheet_Change(ByVal Target As Range)
  
  Dim lastrow As Long
  Dim rngList As Range
  
  lastrow = Cells(Rows.Count, "A").End(xlUp).Row
  
  Set rngList = Range("AC3").CurrentRegion
  
  If Target.Cells.Count &gt; 1 Then Exit Sub
  
  On Error Resume Next
  
  If Not Intersect(Target, Range("B10:B11")) Is Nothing Then  ' user is in column-A
      Target.Value = Application.WorksheetFunction.VLookup(Target.Value, rngList, 2, False)
  End If
  
  Set rngList = Nothing
  </code></pre>
  
  <p>End Sub</p>
  
  <p>I would like to combine them so that I can use both, but I don't know how to do so without conflict, any help would be appreciated, thank you.</p>