title: Automatic Multi-level Sorting in VBA
body: <p>I currently have the following code that works and every time something is typed in, it is automatically sorted by column I</p>
  
  <pre><code>Private Sub Worksheet_Change(ByVal Target As Excel.Range)
  
      If Target.Column = 9 Then
          Dim lastRow As Long
          lastRow = ActiveSheet.Cells.Find(What:="*", LookIn:=xlValues, 
                 SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row 
          Range("A2:I" &amp; lastRow).Sort Key1:=Range("I2:I" &amp; lastRow), 
                Order1:=xlAscending, Header:=xlNo
  
      End If
  End Sub
  </code></pre>
  
  <p>I want it so that it is primarily sorted by item I, but also secondarily sorted by column A. Any help please?</p>